Regenerate and update to new gir and glib-rs version
authorFelix Krull <f_krull@gmx.de>
Mon, 20 May 2019 22:08:26 +0000 (00:08 +0200)
committerColin Walters <walters@verbum.org>
Fri, 6 May 2022 16:53:53 +0000 (12:53 -0400)
28 files changed:
rust-bindings/rust/Cargo.toml
rust-bindings/rust/conf/ostree.toml
rust-bindings/rust/src/auto/async_progress.rs
rust-bindings/rust/src/auto/bootconfig_parser.rs
rust-bindings/rust/src/auto/constants.rs
rust-bindings/rust/src/auto/deployment.rs
rust-bindings/rust/src/auto/enums.rs
rust-bindings/rust/src/auto/flags.rs
rust-bindings/rust/src/auto/functions.rs
rust-bindings/rust/src/auto/gpg_verify_result.rs
rust-bindings/rust/src/auto/mod.rs
rust-bindings/rust/src/auto/mutable_tree.rs
rust-bindings/rust/src/auto/remote.rs
rust-bindings/rust/src/auto/repo.rs
rust-bindings/rust/src/auto/repo_commit_modifier.rs
rust-bindings/rust/src/auto/repo_dev_ino_cache.rs
rust-bindings/rust/src/auto/repo_file.rs
rust-bindings/rust/src/auto/repo_transaction_stats.rs
rust-bindings/rust/src/auto/se_policy.rs
rust-bindings/rust/src/auto/sysroot.rs
rust-bindings/rust/src/auto/sysroot_upgrader.rs
rust-bindings/rust/src/auto/versions.txt
rust-bindings/rust/src/collection_ref/mod.rs
rust-bindings/rust/src/collection_ref/tests.rs
rust-bindings/rust/src/lib.rs
rust-bindings/rust/src/object_name.rs
rust-bindings/rust/src/repo/mod.rs
rust-bindings/rust/tests/roundtrip.rs

index 48f3edadfc1d97018d73798722f88ef7d85ad27a..d8fbc959ec1110313cd9f0c4e1bd12a07cda1434 100644 (file)
@@ -31,12 +31,12 @@ name = "ostree"
 libc = "0.2"
 bitflags = "1"
 lazy_static = "1.1"
-glib = "0.6"
-gio = "0.5"
-glib-sys = "0.7"
-gobject-sys = "0.7"
-gio-sys = "0.7"
-ostree-sys = { version = "0.3", path = "sys" }
+glib = "0.7.1"
+gio = "0.6.0"
+glib-sys = "0.8.0"
+gobject-sys = "0.8.0"
+gio-sys = "0.8.0"
+ostree-sys = { version = "0.3.0", path = "sys" }
 
 [dev-dependencies]
 tempfile = "3"
index b531bcfa3190cedb01a5939fba78226c32e2e32c..514f4870a0aa3b75235aa4ae559178579c1f1078 100644 (file)
@@ -61,6 +61,9 @@ manual = [
     "GLib.Variant",
 ]
 
+[crate_name_overrides]
+os_tree = "ostree"
+
 [[object]]
 name = "OSTree.CollectionRef"
 status = "manual"
index ea95a329c507ad445d2780861af29872446d05d0..e8c666d8495c55a38f7063de15acd67970afaf18 100644 (file)
@@ -2,37 +2,38 @@
 // from gir-files (https://github.com/gtk-rs/gir-files)
 // DO NOT EDIT
 
-use ffi;
+#[cfg(any(feature = "v2017_6", feature = "dox"))]
 use glib;
-use glib::object::Downcast;
+#[cfg(any(feature = "v2017_6", feature = "dox"))]
+use glib::GString;
+use glib::object::Cast;
 use glib::object::IsA;
 use glib::signal::SignalHandlerId;
-use glib::signal::connect;
+use glib::signal::connect_raw;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
+use glib_sys;
+use ostree_sys;
 use std::boxed::Box as Box_;
-use std::mem;
+use std::fmt;
 use std::mem::transmute;
-use std::ptr;
 
 glib_wrapper! {
-    pub struct AsyncProgress(Object<ffi::OstreeAsyncProgress, ffi::OstreeAsyncProgressClass>);
+    pub struct AsyncProgress(Object<ostree_sys::OstreeAsyncProgress, ostree_sys::OstreeAsyncProgressClass, AsyncProgressClass>);
 
     match fn {
-        get_type => || ffi::ostree_async_progress_get_type(),
+        get_type => || ostree_sys::ostree_async_progress_get_type(),
     }
 }
 
 impl AsyncProgress {
     pub fn new() -> AsyncProgress {
         unsafe {
-            from_glib_full(ffi::ostree_async_progress_new())
+            from_glib_full(ostree_sys::ostree_async_progress_new())
         }
     }
 
-    //pub fn new_and_connect<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(changed: P, user_data: Q) -> AsyncProgress {
-    //    unsafe { TODO: call ffi::ostree_async_progress_new_and_connect() }
+    //pub fn new_and_connect(changed: /*Unimplemented*/Option<Fundamental: Pointer>, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> AsyncProgress {
+    //    unsafe { TODO: call ostree_sys:ostree_async_progress_new_and_connect() }
     //}
 }
 
@@ -42,14 +43,16 @@ impl Default for AsyncProgress {
     }
 }
 
-pub trait AsyncProgressExt {
+pub const NONE_ASYNC_PROGRESS: Option<&AsyncProgress> = None;
+
+pub trait AsyncProgressExt: 'static {
     fn finish(&self);
 
     //#[cfg(any(feature = "v2017_6", feature = "dox"))]
     //fn get(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
 
     #[cfg(any(feature = "v2017_6", feature = "dox"))]
-    fn get_status(&self) -> Option<String>;
+    fn get_status(&self) -> Option<GString>;
 
     fn get_uint(&self, key: &str) -> u32;
 
@@ -62,7 +65,7 @@ pub trait AsyncProgressExt {
     //fn set(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
 
     #[cfg(any(feature = "v2017_6", feature = "dox"))]
-    fn set_status<'a, P: Into<Option<&'a str>>>(&self, status: P);
+    fn set_status(&self, status: Option<&str>);
 
     fn set_uint(&self, key: &str, value: u32);
 
@@ -74,88 +77,92 @@ pub trait AsyncProgressExt {
     fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
 }
 
-impl<O: IsA<AsyncProgress> + IsA<glib::object::Object>> AsyncProgressExt for O {
+impl<O: IsA<AsyncProgress>> AsyncProgressExt for O {
     fn finish(&self) {
         unsafe {
-            ffi::ostree_async_progress_finish(self.to_glib_none().0);
+            ostree_sys::ostree_async_progress_finish(self.as_ref().to_glib_none().0);
         }
     }
 
     //#[cfg(any(feature = "v2017_6", feature = "dox"))]
     //fn get(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
-    //    unsafe { TODO: call ffi::ostree_async_progress_get() }
+    //    unsafe { TODO: call ostree_sys:ostree_async_progress_get() }
     //}
 
     #[cfg(any(feature = "v2017_6", feature = "dox"))]
-    fn get_status(&self) -> Option<String> {
+    fn get_status(&self) -> Option<GString> {
         unsafe {
-            from_glib_full(ffi::ostree_async_progress_get_status(self.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_async_progress_get_status(self.as_ref().to_glib_none().0))
         }
     }
 
     fn get_uint(&self, key: &str) -> u32 {
         unsafe {
-            ffi::ostree_async_progress_get_uint(self.to_glib_none().0, key.to_glib_none().0)
+            ostree_sys::ostree_async_progress_get_uint(self.as_ref().to_glib_none().0, key.to_glib_none().0)
         }
     }
 
     fn get_uint64(&self, key: &str) -> u64 {
         unsafe {
-            ffi::ostree_async_progress_get_uint64(self.to_glib_none().0, key.to_glib_none().0)
+            ostree_sys::ostree_async_progress_get_uint64(self.as_ref().to_glib_none().0, key.to_glib_none().0)
         }
     }
 
     #[cfg(any(feature = "v2017_6", feature = "dox"))]
     fn get_variant(&self, key: &str) -> Option<glib::Variant> {
         unsafe {
-            from_glib_full(ffi::ostree_async_progress_get_variant(self.to_glib_none().0, key.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_async_progress_get_variant(self.as_ref().to_glib_none().0, key.to_glib_none().0))
         }
     }
 
     //#[cfg(any(feature = "v2017_6", feature = "dox"))]
     //fn set(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
-    //    unsafe { TODO: call ffi::ostree_async_progress_set() }
+    //    unsafe { TODO: call ostree_sys:ostree_async_progress_set() }
     //}
 
     #[cfg(any(feature = "v2017_6", feature = "dox"))]
-    fn set_status<'a, P: Into<Option<&'a str>>>(&self, status: P) {
-        let status = status.into();
-        let status = status.to_glib_none();
+    fn set_status(&self, status: Option<&str>) {
         unsafe {
-            ffi::ostree_async_progress_set_status(self.to_glib_none().0, status.0);
+            ostree_sys::ostree_async_progress_set_status(self.as_ref().to_glib_none().0, status.to_glib_none().0);
         }
     }
 
     fn set_uint(&self, key: &str, value: u32) {
         unsafe {
-            ffi::ostree_async_progress_set_uint(self.to_glib_none().0, key.to_glib_none().0, value);
+            ostree_sys::ostree_async_progress_set_uint(self.as_ref().to_glib_none().0, key.to_glib_none().0, value);
         }
     }
 
     fn set_uint64(&self, key: &str, value: u64) {
         unsafe {
-            ffi::ostree_async_progress_set_uint64(self.to_glib_none().0, key.to_glib_none().0, value);
+            ostree_sys::ostree_async_progress_set_uint64(self.as_ref().to_glib_none().0, key.to_glib_none().0, value);
         }
     }
 
     #[cfg(any(feature = "v2017_6", feature = "dox"))]
     fn set_variant(&self, key: &str, value: &glib::Variant) {
         unsafe {
-            ffi::ostree_async_progress_set_variant(self.to_glib_none().0, key.to_glib_none().0, value.to_glib_none().0);
+            ostree_sys::ostree_async_progress_set_variant(self.as_ref().to_glib_none().0, key.to_glib_none().0, value.to_glib_none().0);
         }
     }
 
     fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
         unsafe {
-            let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
-            connect(self.to_glib_none().0, "changed",
-                transmute(changed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
+            let f: Box_<F> = Box_::new(f);
+            connect_raw(self.as_ptr() as *mut _, b"changed\0".as_ptr() as *const _,
+                Some(transmute(changed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
         }
     }
 }
 
-unsafe extern "C" fn changed_trampoline<P>(this: *mut ffi::OstreeAsyncProgress, f: glib_ffi::gpointer)
+unsafe extern "C" fn changed_trampoline<P, F: Fn(&P) + 'static>(this: *mut ostree_sys::OstreeAsyncProgress, f: glib_sys::gpointer)
 where P: IsA<AsyncProgress> {
-    let f: &&(Fn(&P) + 'static) = transmute(f);
-    f(&AsyncProgress::from_glib_borrow(this).downcast_unchecked())
+    let f: &F = &*(f as *const F);
+    f(&AsyncProgress::from_glib_borrow(this).unsafe_cast())
+}
+
+impl fmt::Display for AsyncProgress {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "AsyncProgress")
+    }
 }
index 6b2507eedf12feef3bf62f3f5e6764070546a350..8bbfd2f7b23aacb1c3ec55cc6a7d359272a8e722 100644 (file)
 // DO NOT EDIT
 
 use Error;
-use ffi;
 use gio;
+use glib::GString;
 use glib::object::IsA;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
-use std::mem;
+use ostree_sys;
+use std::fmt;
 use std::ptr;
 
 glib_wrapper! {
-    pub struct BootconfigParser(Object<ffi::OstreeBootconfigParser>);
+    pub struct BootconfigParser(Object<ostree_sys::OstreeBootconfigParser, BootconfigParserClass>);
 
     match fn {
-        get_type => || ffi::ostree_bootconfig_parser_get_type(),
+        get_type => || ostree_sys::ostree_bootconfig_parser_get_type(),
     }
 }
 
 impl BootconfigParser {
     pub fn new() -> BootconfigParser {
         unsafe {
-            from_glib_full(ffi::ostree_bootconfig_parser_new())
+            from_glib_full(ostree_sys::ostree_bootconfig_parser_new())
         }
     }
-}
-
-impl Default for BootconfigParser {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-pub trait BootconfigParserExt {
-    fn clone(&self) -> Option<BootconfigParser>;
-
-    fn get(&self, key: &str) -> Option<String>;
-
-    fn parse<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, path: &P, cancellable: Q) -> Result<(), Error>;
-
-    fn parse_at<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, dfd: i32, path: &str, cancellable: P) -> Result<(), Error>;
-
-    fn set(&self, key: &str, value: &str);
 
-    fn write<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, output: &P, cancellable: Q) -> Result<(), Error>;
-
-    fn write_at<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, dfd: i32, path: &str, cancellable: P) -> Result<(), Error>;
-}
-
-impl<O: IsA<BootconfigParser>> BootconfigParserExt for O {
-    fn clone(&self) -> Option<BootconfigParser> {
+    pub fn clone(&self) -> Option<BootconfigParser> {
         unsafe {
-            from_glib_full(ffi::ostree_bootconfig_parser_clone(self.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_bootconfig_parser_clone(self.to_glib_none().0))
         }
     }
 
-    fn get(&self, key: &str) -> Option<String> {
+    pub fn get(&self, key: &str) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_bootconfig_parser_get(self.to_glib_none().0, key.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_bootconfig_parser_get(self.to_glib_none().0, key.to_glib_none().0))
         }
     }
 
-    fn parse<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, path: &P, cancellable: Q) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn parse<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, path: &P, cancellable: Option<&Q>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_bootconfig_parser_parse(self.to_glib_none().0, path.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_bootconfig_parser_parse(self.to_glib_none().0, path.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn parse_at<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, dfd: i32, path: &str, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn parse_at<P: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_bootconfig_parser_parse_at(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_bootconfig_parser_parse_at(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn set(&self, key: &str, value: &str) {
+    pub fn set(&self, key: &str, value: &str) {
         unsafe {
-            ffi::ostree_bootconfig_parser_set(self.to_glib_none().0, key.to_glib_none().0, value.to_glib_none().0);
+            ostree_sys::ostree_bootconfig_parser_set(self.to_glib_none().0, key.to_glib_none().0, value.to_glib_none().0);
         }
     }
 
-    fn write<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, output: &P, cancellable: Q) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, output: &P, cancellable: Option<&Q>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_bootconfig_parser_write(self.to_glib_none().0, output.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_bootconfig_parser_write(self.to_glib_none().0, output.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn write_at<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, dfd: i32, path: &str, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_at<P: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_bootconfig_parser_write_at(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_bootconfig_parser_write_at(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 }
+
+impl Default for BootconfigParser {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+impl fmt::Display for BootconfigParser {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "BootconfigParser")
+    }
+}
index f5707eab1dae615d4cabeb61efa599b185fde892..7d6833ff2272da0995ad08a350e8f4de1f93b19c 100644 (file)
@@ -2,60 +2,60 @@
 // from gir-files (https://github.com/gtk-rs/gir-files)
 // DO NOT EDIT
 
-use ffi;
+use ostree_sys;
 use std::ffi::CStr;
 
 lazy_static! {
-    pub static ref COMMIT_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_GVARIANT_STRING).to_str().unwrap()};
+    pub static ref COMMIT_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_GVARIANT_STRING).to_str().unwrap()};
 }
 #[cfg(any(feature = "v2018_6", feature = "dox"))]
 lazy_static! {
-    pub static ref COMMIT_META_KEY_COLLECTION_BINDING: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING).to_str().unwrap()};
+    pub static ref COMMIT_META_KEY_COLLECTION_BINDING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING).to_str().unwrap()};
 }
 #[cfg(any(feature = "v2017_7", feature = "dox"))]
 lazy_static! {
-    pub static ref COMMIT_META_KEY_ENDOFLIFE: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE).to_str().unwrap()};
+    pub static ref COMMIT_META_KEY_ENDOFLIFE: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE).to_str().unwrap()};
 }
 #[cfg(any(feature = "v2017_7", feature = "dox"))]
 lazy_static! {
-    pub static ref COMMIT_META_KEY_ENDOFLIFE_REBASE: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE).to_str().unwrap()};
+    pub static ref COMMIT_META_KEY_ENDOFLIFE_REBASE: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE).to_str().unwrap()};
 }
 #[cfg(any(feature = "v2017_9", feature = "dox"))]
 lazy_static! {
-    pub static ref COMMIT_META_KEY_REF_BINDING: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_REF_BINDING).to_str().unwrap()};
+    pub static ref COMMIT_META_KEY_REF_BINDING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_REF_BINDING).to_str().unwrap()};
 }
 #[cfg(any(feature = "v2017_13", feature = "dox"))]
 lazy_static! {
-    pub static ref COMMIT_META_KEY_SOURCE_TITLE: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_SOURCE_TITLE).to_str().unwrap()};
+    pub static ref COMMIT_META_KEY_SOURCE_TITLE: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_SOURCE_TITLE).to_str().unwrap()};
 }
 #[cfg(any(feature = "v2014_9", feature = "dox"))]
 lazy_static! {
-    pub static ref COMMIT_META_KEY_VERSION: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_VERSION).to_str().unwrap()};
+    pub static ref COMMIT_META_KEY_VERSION: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_VERSION).to_str().unwrap()};
 }
 lazy_static! {
-    pub static ref DIRMETA_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_DIRMETA_GVARIANT_STRING).to_str().unwrap()};
+    pub static ref DIRMETA_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_DIRMETA_GVARIANT_STRING).to_str().unwrap()};
 }
 lazy_static! {
-    pub static ref FILEMETA_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_FILEMETA_GVARIANT_STRING).to_str().unwrap()};
+    pub static ref FILEMETA_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_FILEMETA_GVARIANT_STRING).to_str().unwrap()};
 }
 #[cfg(any(feature = "v2018_9", feature = "dox"))]
 lazy_static! {
-    pub static ref META_KEY_DEPLOY_COLLECTION_ID: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_META_KEY_DEPLOY_COLLECTION_ID).to_str().unwrap()};
+    pub static ref META_KEY_DEPLOY_COLLECTION_ID: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_META_KEY_DEPLOY_COLLECTION_ID).to_str().unwrap()};
 }
 #[cfg(any(feature = "v2018_3", feature = "dox"))]
 lazy_static! {
-    pub static ref ORIGIN_TRANSIENT_GROUP: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_ORIGIN_TRANSIENT_GROUP).to_str().unwrap()};
+    pub static ref ORIGIN_TRANSIENT_GROUP: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_ORIGIN_TRANSIENT_GROUP).to_str().unwrap()};
 }
 #[cfg(any(feature = "v2018_6", feature = "dox"))]
 lazy_static! {
-    pub static ref REPO_METADATA_REF: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_REPO_METADATA_REF).to_str().unwrap()};
+    pub static ref REPO_METADATA_REF: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_REPO_METADATA_REF).to_str().unwrap()};
 }
 lazy_static! {
-    pub static ref SUMMARY_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_SUMMARY_GVARIANT_STRING).to_str().unwrap()};
+    pub static ref SUMMARY_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_GVARIANT_STRING).to_str().unwrap()};
 }
 lazy_static! {
-    pub static ref SUMMARY_SIG_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_SUMMARY_SIG_GVARIANT_STRING).to_str().unwrap()};
+    pub static ref SUMMARY_SIG_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_SIG_GVARIANT_STRING).to_str().unwrap()};
 }
 lazy_static! {
-    pub static ref TREE_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_TREE_GVARIANT_STRING).to_str().unwrap()};
+    pub static ref TREE_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_TREE_GVARIANT_STRING).to_str().unwrap()};
 }
index 2c7ec27ee6e6cbebfc805bc440cf019026ff5489..e2ed855a94c59b763890eaa4b8faee7c12fcdb18 100644 (file)
 use BootconfigParser;
 #[cfg(any(feature = "v2016_4", feature = "dox"))]
 use DeploymentUnlockedState;
-use ffi;
 use glib;
-use glib::object::IsA;
+use glib::GString;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
-use std::mem;
-use std::ptr;
+use glib_sys;
+use ostree_sys;
+use std::fmt;
 
 glib_wrapper! {
-    pub struct Deployment(Object<ffi::OstreeDeployment>);
+    pub struct Deployment(Object<ostree_sys::OstreeDeployment, DeploymentClass>);
 
     match fn {
-        get_type => || ffi::ostree_deployment_get_type(),
+        get_type => || ostree_sys::ostree_deployment_get_type(),
     }
 }
 
 impl Deployment {
     pub fn new(index: i32, osname: &str, csum: &str, deployserial: i32, bootcsum: &str, bootserial: i32) -> Deployment {
         unsafe {
-            from_glib_full(ffi::ostree_deployment_new(index, osname.to_glib_none().0, csum.to_glib_none().0, deployserial, bootcsum.to_glib_none().0, bootserial))
+            from_glib_full(ostree_sys::ostree_deployment_new(index, osname.to_glib_none().0, csum.to_glib_none().0, deployserial, bootcsum.to_glib_none().0, bootserial))
         }
     }
 
-    pub fn hash(&self) -> u32 {
+    pub fn clone(&self) -> Option<Deployment> {
         unsafe {
-            ffi::ostree_deployment_hash(ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0 as glib_ffi::gconstpointer)
+            from_glib_full(ostree_sys::ostree_deployment_clone(self.to_glib_none().0))
         }
     }
 
-    #[cfg(any(feature = "v2018_3", feature = "dox"))]
-    pub fn origin_remove_transient_state(origin: &glib::KeyFile) {
+    pub fn equal(&self, bp: &Deployment) -> bool {
         unsafe {
-            ffi::ostree_deployment_origin_remove_transient_state(origin.to_glib_none().0);
+            from_glib(ostree_sys::ostree_deployment_equal(ToGlibPtr::<*mut ostree_sys::OstreeDeployment>::to_glib_none(self).0 as glib_sys::gconstpointer, ToGlibPtr::<*mut ostree_sys::OstreeDeployment>::to_glib_none(bp).0 as glib_sys::gconstpointer))
         }
     }
 
-    #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> Option<String> {
+    pub fn get_bootconfig(&self) -> Option<BootconfigParser> {
         unsafe {
-            from_glib_none(ffi::ostree_deployment_unlocked_state_to_string(state.to_glib()))
+            from_glib_none(ostree_sys::ostree_deployment_get_bootconfig(self.to_glib_none().0))
         }
     }
-}
-
-pub trait DeploymentExt {
-    fn clone(&self) -> Option<Deployment>;
-
-    fn equal(&self, bp: &Deployment) -> bool;
-
-    fn get_bootconfig(&self) -> Option<BootconfigParser>;
-
-    fn get_bootcsum(&self) -> Option<String>;
-
-    fn get_bootserial(&self) -> i32;
-
-    fn get_csum(&self) -> Option<String>;
-
-    fn get_deployserial(&self) -> i32;
-
-    fn get_index(&self) -> i32;
-
-    fn get_origin(&self) -> Option<glib::KeyFile>;
-
-    fn get_origin_relpath(&self) -> Option<String>;
-
-    fn get_osname(&self) -> Option<String>;
-
-    #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn get_unlocked(&self) -> DeploymentUnlockedState;
-
-    #[cfg(any(feature = "v2018_3", feature = "dox"))]
-    fn is_pinned(&self) -> bool;
 
-    #[cfg(any(feature = "v2018_3", feature = "dox"))]
-    fn is_staged(&self) -> bool;
-
-    fn set_bootconfig(&self, bootconfig: &BootconfigParser);
-
-    fn set_bootserial(&self, index: i32);
-
-    fn set_index(&self, index: i32);
-
-    fn set_origin(&self, origin: &glib::KeyFile);
-}
-
-impl<O: IsA<Deployment>> DeploymentExt for O {
-    fn clone(&self) -> Option<Deployment> {
+    pub fn get_bootcsum(&self) -> Option<GString> {
         unsafe {
-            from_glib_full(ffi::ostree_deployment_clone(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_deployment_get_bootcsum(self.to_glib_none().0))
         }
     }
 
-    fn equal(&self, bp: &Deployment) -> bool {
+    pub fn get_bootserial(&self) -> i32 {
         unsafe {
-            from_glib(ffi::ostree_deployment_equal(ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0 as glib_ffi::gconstpointer, ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(bp).0 as glib_ffi::gconstpointer))
+            ostree_sys::ostree_deployment_get_bootserial(self.to_glib_none().0)
         }
     }
 
-    fn get_bootconfig(&self) -> Option<BootconfigParser> {
+    pub fn get_csum(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_deployment_get_bootconfig(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_deployment_get_csum(self.to_glib_none().0))
         }
     }
 
-    fn get_bootcsum(&self) -> Option<String> {
+    pub fn get_deployserial(&self) -> i32 {
         unsafe {
-            from_glib_none(ffi::ostree_deployment_get_bootcsum(self.to_glib_none().0))
+            ostree_sys::ostree_deployment_get_deployserial(self.to_glib_none().0)
         }
     }
 
-    fn get_bootserial(&self) -> i32 {
+    pub fn get_index(&self) -> i32 {
         unsafe {
-            ffi::ostree_deployment_get_bootserial(self.to_glib_none().0)
+            ostree_sys::ostree_deployment_get_index(self.to_glib_none().0)
         }
     }
 
-    fn get_csum(&self) -> Option<String> {
+    pub fn get_origin(&self) -> Option<glib::KeyFile> {
         unsafe {
-            from_glib_none(ffi::ostree_deployment_get_csum(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_deployment_get_origin(self.to_glib_none().0))
         }
     }
 
-    fn get_deployserial(&self) -> i32 {
+    pub fn get_origin_relpath(&self) -> Option<GString> {
         unsafe {
-            ffi::ostree_deployment_get_deployserial(self.to_glib_none().0)
+            from_glib_full(ostree_sys::ostree_deployment_get_origin_relpath(self.to_glib_none().0))
         }
     }
 
-    fn get_index(&self) -> i32 {
+    pub fn get_osname(&self) -> Option<GString> {
         unsafe {
-            ffi::ostree_deployment_get_index(self.to_glib_none().0)
+            from_glib_none(ostree_sys::ostree_deployment_get_osname(self.to_glib_none().0))
         }
     }
 
-    fn get_origin(&self) -> Option<glib::KeyFile> {
+    #[cfg(any(feature = "v2016_4", feature = "dox"))]
+    pub fn get_unlocked(&self) -> DeploymentUnlockedState {
         unsafe {
-            from_glib_none(ffi::ostree_deployment_get_origin(self.to_glib_none().0))
+            from_glib(ostree_sys::ostree_deployment_get_unlocked(self.to_glib_none().0))
         }
     }
 
-    fn get_origin_relpath(&self) -> Option<String> {
+    #[cfg(any(feature = "v2018_3", feature = "dox"))]
+    pub fn is_pinned(&self) -> bool {
         unsafe {
-            from_glib_full(ffi::ostree_deployment_get_origin_relpath(self.to_glib_none().0))
+            from_glib(ostree_sys::ostree_deployment_is_pinned(self.to_glib_none().0))
         }
     }
 
-    fn get_osname(&self) -> Option<String> {
+    #[cfg(any(feature = "v2018_3", feature = "dox"))]
+    pub fn is_staged(&self) -> bool {
         unsafe {
-            from_glib_none(ffi::ostree_deployment_get_osname(self.to_glib_none().0))
+            from_glib(ostree_sys::ostree_deployment_is_staged(self.to_glib_none().0))
         }
     }
 
-    #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn get_unlocked(&self) -> DeploymentUnlockedState {
+    pub fn set_bootconfig(&self, bootconfig: &BootconfigParser) {
         unsafe {
-            from_glib(ffi::ostree_deployment_get_unlocked(self.to_glib_none().0))
+            ostree_sys::ostree_deployment_set_bootconfig(self.to_glib_none().0, bootconfig.to_glib_none().0);
         }
     }
 
-    #[cfg(any(feature = "v2018_3", feature = "dox"))]
-    fn is_pinned(&self) -> bool {
+    pub fn set_bootserial(&self, index: i32) {
         unsafe {
-            from_glib(ffi::ostree_deployment_is_pinned(self.to_glib_none().0))
+            ostree_sys::ostree_deployment_set_bootserial(self.to_glib_none().0, index);
         }
     }
 
-    #[cfg(any(feature = "v2018_3", feature = "dox"))]
-    fn is_staged(&self) -> bool {
+    pub fn set_index(&self, index: i32) {
         unsafe {
-            from_glib(ffi::ostree_deployment_is_staged(self.to_glib_none().0))
+            ostree_sys::ostree_deployment_set_index(self.to_glib_none().0, index);
         }
     }
 
-    fn set_bootconfig(&self, bootconfig: &BootconfigParser) {
+    pub fn set_origin(&self, origin: &glib::KeyFile) {
         unsafe {
-            ffi::ostree_deployment_set_bootconfig(self.to_glib_none().0, bootconfig.to_glib_none().0);
+            ostree_sys::ostree_deployment_set_origin(self.to_glib_none().0, origin.to_glib_none().0);
         }
     }
 
-    fn set_bootserial(&self, index: i32) {
+    pub fn hash(&self) -> u32 {
         unsafe {
-            ffi::ostree_deployment_set_bootserial(self.to_glib_none().0, index);
+            ostree_sys::ostree_deployment_hash(ToGlibPtr::<*mut ostree_sys::OstreeDeployment>::to_glib_none(self).0 as glib_sys::gconstpointer)
         }
     }
 
-    fn set_index(&self, index: i32) {
+    #[cfg(any(feature = "v2018_3", feature = "dox"))]
+    pub fn origin_remove_transient_state(origin: &glib::KeyFile) {
         unsafe {
-            ffi::ostree_deployment_set_index(self.to_glib_none().0, index);
+            ostree_sys::ostree_deployment_origin_remove_transient_state(origin.to_glib_none().0);
         }
     }
 
-    fn set_origin(&self, origin: &glib::KeyFile) {
+    #[cfg(any(feature = "v2016_4", feature = "dox"))]
+    pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> Option<GString> {
         unsafe {
-            ffi::ostree_deployment_set_origin(self.to_glib_none().0, origin.to_glib_none().0);
+            from_glib_none(ostree_sys::ostree_deployment_unlocked_state_to_string(state.to_glib()))
         }
     }
 }
+
+impl fmt::Display for Deployment {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "Deployment")
+    }
+}
index c016888abce7152a8d1977cc6a44418220b3a4b6..b62f254a0ff9dfc4158956606015a17352450e13 100644 (file)
@@ -2,8 +2,9 @@
 // from gir-files (https://github.com/gtk-rs/gir-files)
 // DO NOT EDIT
 
-use ffi;
 use glib::translate::*;
+use ostree_sys;
+use std::fmt;
 
 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
 #[derive(Clone, Copy)]
@@ -15,23 +16,34 @@ pub enum DeploymentUnlockedState {
     __Unknown(i32),
 }
 
+impl fmt::Display for DeploymentUnlockedState {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "DeploymentUnlockedState::{}", match *self {
+            DeploymentUnlockedState::None => "None",
+            DeploymentUnlockedState::Development => "Development",
+            DeploymentUnlockedState::Hotfix => "Hotfix",
+            _ => "Unknown",
+        })
+    }
+}
+
 #[doc(hidden)]
 impl ToGlib for DeploymentUnlockedState {
-    type GlibType = ffi::OstreeDeploymentUnlockedState;
+    type GlibType = ostree_sys::OstreeDeploymentUnlockedState;
 
-    fn to_glib(&self) -> ffi::OstreeDeploymentUnlockedState {
+    fn to_glib(&self) -> ostree_sys::OstreeDeploymentUnlockedState {
         match *self {
-            DeploymentUnlockedState::None => ffi::OSTREE_DEPLOYMENT_UNLOCKED_NONE,
-            DeploymentUnlockedState::Development => ffi::OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT,
-            DeploymentUnlockedState::Hotfix => ffi::OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX,
+            DeploymentUnlockedState::None => ostree_sys::OSTREE_DEPLOYMENT_UNLOCKED_NONE,
+            DeploymentUnlockedState::Development => ostree_sys::OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT,
+            DeploymentUnlockedState::Hotfix => ostree_sys::OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX,
             DeploymentUnlockedState::__Unknown(value) => value
         }
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeDeploymentUnlockedState> for DeploymentUnlockedState {
-    fn from_glib(value: ffi::OstreeDeploymentUnlockedState) -> Self {
+impl FromGlib<ostree_sys::OstreeDeploymentUnlockedState> for DeploymentUnlockedState {
+    fn from_glib(value: ostree_sys::OstreeDeploymentUnlockedState) -> Self {
         match value {
             0 => DeploymentUnlockedState::None,
             1 => DeploymentUnlockedState::Development,
@@ -49,21 +61,30 @@ pub enum GpgSignatureFormatFlags {
     __Unknown(i32),
 }
 
+impl fmt::Display for GpgSignatureFormatFlags {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "GpgSignatureFormatFlags::{}", match *self {
+            GpgSignatureFormatFlags::GpgSignatureFormatDefault => "GpgSignatureFormatDefault",
+            _ => "Unknown",
+        })
+    }
+}
+
 #[doc(hidden)]
 impl ToGlib for GpgSignatureFormatFlags {
-    type GlibType = ffi::OstreeGpgSignatureFormatFlags;
+    type GlibType = ostree_sys::OstreeGpgSignatureFormatFlags;
 
-    fn to_glib(&self) -> ffi::OstreeGpgSignatureFormatFlags {
+    fn to_glib(&self) -> ostree_sys::OstreeGpgSignatureFormatFlags {
         match *self {
-            GpgSignatureFormatFlags::GpgSignatureFormatDefault => ffi::OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT,
+            GpgSignatureFormatFlags::GpgSignatureFormatDefault => ostree_sys::OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT,
             GpgSignatureFormatFlags::__Unknown(value) => value
         }
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeGpgSignatureFormatFlags> for GpgSignatureFormatFlags {
-    fn from_glib(value: ffi::OstreeGpgSignatureFormatFlags) -> Self {
+impl FromGlib<ostree_sys::OstreeGpgSignatureFormatFlags> for GpgSignatureFormatFlags {
+    fn from_glib(value: ostree_sys::OstreeGpgSignatureFormatFlags) -> Self {
         match value {
             0 => GpgSignatureFormatFlags::GpgSignatureFormatDefault,
             value => GpgSignatureFormatFlags::__Unknown(value),
@@ -85,27 +106,42 @@ pub enum ObjectType {
     __Unknown(i32),
 }
 
+impl fmt::Display for ObjectType {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "ObjectType::{}", match *self {
+            ObjectType::File => "File",
+            ObjectType::DirTree => "DirTree",
+            ObjectType::DirMeta => "DirMeta",
+            ObjectType::Commit => "Commit",
+            ObjectType::TombstoneCommit => "TombstoneCommit",
+            ObjectType::CommitMeta => "CommitMeta",
+            ObjectType::PayloadLink => "PayloadLink",
+            _ => "Unknown",
+        })
+    }
+}
+
 #[doc(hidden)]
 impl ToGlib for ObjectType {
-    type GlibType = ffi::OstreeObjectType;
+    type GlibType = ostree_sys::OstreeObjectType;
 
-    fn to_glib(&self) -> ffi::OstreeObjectType {
+    fn to_glib(&self) -> ostree_sys::OstreeObjectType {
         match *self {
-            ObjectType::File => ffi::OSTREE_OBJECT_TYPE_FILE,
-            ObjectType::DirTree => ffi::OSTREE_OBJECT_TYPE_DIR_TREE,
-            ObjectType::DirMeta => ffi::OSTREE_OBJECT_TYPE_DIR_META,
-            ObjectType::Commit => ffi::OSTREE_OBJECT_TYPE_COMMIT,
-            ObjectType::TombstoneCommit => ffi::OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT,
-            ObjectType::CommitMeta => ffi::OSTREE_OBJECT_TYPE_COMMIT_META,
-            ObjectType::PayloadLink => ffi::OSTREE_OBJECT_TYPE_PAYLOAD_LINK,
+            ObjectType::File => ostree_sys::OSTREE_OBJECT_TYPE_FILE,
+            ObjectType::DirTree => ostree_sys::OSTREE_OBJECT_TYPE_DIR_TREE,
+            ObjectType::DirMeta => ostree_sys::OSTREE_OBJECT_TYPE_DIR_META,
+            ObjectType::Commit => ostree_sys::OSTREE_OBJECT_TYPE_COMMIT,
+            ObjectType::TombstoneCommit => ostree_sys::OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT,
+            ObjectType::CommitMeta => ostree_sys::OSTREE_OBJECT_TYPE_COMMIT_META,
+            ObjectType::PayloadLink => ostree_sys::OSTREE_OBJECT_TYPE_PAYLOAD_LINK,
             ObjectType::__Unknown(value) => value
         }
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeObjectType> for ObjectType {
-    fn from_glib(value: ffi::OstreeObjectType) -> Self {
+impl FromGlib<ostree_sys::OstreeObjectType> for ObjectType {
+    fn from_glib(value: ostree_sys::OstreeObjectType) -> Self {
         match value {
             1 => ObjectType::File,
             2 => ObjectType::DirTree,
@@ -128,22 +164,32 @@ pub enum RepoCheckoutMode {
     __Unknown(i32),
 }
 
+impl fmt::Display for RepoCheckoutMode {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "RepoCheckoutMode::{}", match *self {
+            RepoCheckoutMode::None => "None",
+            RepoCheckoutMode::User => "User",
+            _ => "Unknown",
+        })
+    }
+}
+
 #[doc(hidden)]
 impl ToGlib for RepoCheckoutMode {
-    type GlibType = ffi::OstreeRepoCheckoutMode;
+    type GlibType = ostree_sys::OstreeRepoCheckoutMode;
 
-    fn to_glib(&self) -> ffi::OstreeRepoCheckoutMode {
+    fn to_glib(&self) -> ostree_sys::OstreeRepoCheckoutMode {
         match *self {
-            RepoCheckoutMode::None => ffi::OSTREE_REPO_CHECKOUT_MODE_NONE,
-            RepoCheckoutMode::User => ffi::OSTREE_REPO_CHECKOUT_MODE_USER,
+            RepoCheckoutMode::None => ostree_sys::OSTREE_REPO_CHECKOUT_MODE_NONE,
+            RepoCheckoutMode::User => ostree_sys::OSTREE_REPO_CHECKOUT_MODE_USER,
             RepoCheckoutMode::__Unknown(value) => value
         }
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeRepoCheckoutMode> for RepoCheckoutMode {
-    fn from_glib(value: ffi::OstreeRepoCheckoutMode) -> Self {
+impl FromGlib<ostree_sys::OstreeRepoCheckoutMode> for RepoCheckoutMode {
+    fn from_glib(value: ostree_sys::OstreeRepoCheckoutMode) -> Self {
         match value {
             0 => RepoCheckoutMode::None,
             1 => RepoCheckoutMode::User,
@@ -163,24 +209,36 @@ pub enum RepoCheckoutOverwriteMode {
     __Unknown(i32),
 }
 
+impl fmt::Display for RepoCheckoutOverwriteMode {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "RepoCheckoutOverwriteMode::{}", match *self {
+            RepoCheckoutOverwriteMode::None => "None",
+            RepoCheckoutOverwriteMode::UnionFiles => "UnionFiles",
+            RepoCheckoutOverwriteMode::AddFiles => "AddFiles",
+            RepoCheckoutOverwriteMode::UnionIdentical => "UnionIdentical",
+            _ => "Unknown",
+        })
+    }
+}
+
 #[doc(hidden)]
 impl ToGlib for RepoCheckoutOverwriteMode {
-    type GlibType = ffi::OstreeRepoCheckoutOverwriteMode;
+    type GlibType = ostree_sys::OstreeRepoCheckoutOverwriteMode;
 
-    fn to_glib(&self) -> ffi::OstreeRepoCheckoutOverwriteMode {
+    fn to_glib(&self) -> ostree_sys::OstreeRepoCheckoutOverwriteMode {
         match *self {
-            RepoCheckoutOverwriteMode::None => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_NONE,
-            RepoCheckoutOverwriteMode::UnionFiles => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES,
-            RepoCheckoutOverwriteMode::AddFiles => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES,
-            RepoCheckoutOverwriteMode::UnionIdentical => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL,
+            RepoCheckoutOverwriteMode::None => ostree_sys::OSTREE_REPO_CHECKOUT_OVERWRITE_NONE,
+            RepoCheckoutOverwriteMode::UnionFiles => ostree_sys::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES,
+            RepoCheckoutOverwriteMode::AddFiles => ostree_sys::OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES,
+            RepoCheckoutOverwriteMode::UnionIdentical => ostree_sys::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL,
             RepoCheckoutOverwriteMode::__Unknown(value) => value
         }
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeRepoCheckoutOverwriteMode> for RepoCheckoutOverwriteMode {
-    fn from_glib(value: ffi::OstreeRepoCheckoutOverwriteMode) -> Self {
+impl FromGlib<ostree_sys::OstreeRepoCheckoutOverwriteMode> for RepoCheckoutOverwriteMode {
+    fn from_glib(value: ostree_sys::OstreeRepoCheckoutOverwriteMode) -> Self {
         match value {
             0 => RepoCheckoutOverwriteMode::None,
             1 => RepoCheckoutOverwriteMode::UnionFiles,
@@ -202,24 +260,36 @@ pub enum RepoMode {
     __Unknown(i32),
 }
 
+impl fmt::Display for RepoMode {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "RepoMode::{}", match *self {
+            RepoMode::Bare => "Bare",
+            RepoMode::Archive => "Archive",
+            RepoMode::BareUser => "BareUser",
+            RepoMode::BareUserOnly => "BareUserOnly",
+            _ => "Unknown",
+        })
+    }
+}
+
 #[doc(hidden)]
 impl ToGlib for RepoMode {
-    type GlibType = ffi::OstreeRepoMode;
+    type GlibType = ostree_sys::OstreeRepoMode;
 
-    fn to_glib(&self) -> ffi::OstreeRepoMode {
+    fn to_glib(&self) -> ostree_sys::OstreeRepoMode {
         match *self {
-            RepoMode::Bare => ffi::OSTREE_REPO_MODE_BARE,
-            RepoMode::Archive => ffi::OSTREE_REPO_MODE_ARCHIVE,
-            RepoMode::BareUser => ffi::OSTREE_REPO_MODE_BARE_USER,
-            RepoMode::BareUserOnly => ffi::OSTREE_REPO_MODE_BARE_USER_ONLY,
+            RepoMode::Bare => ostree_sys::OSTREE_REPO_MODE_BARE,
+            RepoMode::Archive => ostree_sys::OSTREE_REPO_MODE_ARCHIVE,
+            RepoMode::BareUser => ostree_sys::OSTREE_REPO_MODE_BARE_USER,
+            RepoMode::BareUserOnly => ostree_sys::OSTREE_REPO_MODE_BARE_USER_ONLY,
             RepoMode::__Unknown(value) => value
         }
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeRepoMode> for RepoMode {
-    fn from_glib(value: ffi::OstreeRepoMode) -> Self {
+impl FromGlib<ostree_sys::OstreeRepoMode> for RepoMode {
+    fn from_glib(value: ostree_sys::OstreeRepoMode) -> Self {
         match value {
             0 => RepoMode::Bare,
             1 => RepoMode::Archive,
@@ -240,23 +310,34 @@ pub enum RepoPruneFlags {
     __Unknown(i32),
 }
 
+impl fmt::Display for RepoPruneFlags {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "RepoPruneFlags::{}", match *self {
+            RepoPruneFlags::None => "None",
+            RepoPruneFlags::NoPrune => "NoPrune",
+            RepoPruneFlags::RefsOnly => "RefsOnly",
+            _ => "Unknown",
+        })
+    }
+}
+
 #[doc(hidden)]
 impl ToGlib for RepoPruneFlags {
-    type GlibType = ffi::OstreeRepoPruneFlags;
+    type GlibType = ostree_sys::OstreeRepoPruneFlags;
 
-    fn to_glib(&self) -> ffi::OstreeRepoPruneFlags {
+    fn to_glib(&self) -> ostree_sys::OstreeRepoPruneFlags {
         match *self {
-            RepoPruneFlags::None => ffi::OSTREE_REPO_PRUNE_FLAGS_NONE,
-            RepoPruneFlags::NoPrune => ffi::OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE,
-            RepoPruneFlags::RefsOnly => ffi::OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY,
+            RepoPruneFlags::None => ostree_sys::OSTREE_REPO_PRUNE_FLAGS_NONE,
+            RepoPruneFlags::NoPrune => ostree_sys::OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE,
+            RepoPruneFlags::RefsOnly => ostree_sys::OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY,
             RepoPruneFlags::__Unknown(value) => value
         }
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeRepoPruneFlags> for RepoPruneFlags {
-    fn from_glib(value: ffi::OstreeRepoPruneFlags) -> Self {
+impl FromGlib<ostree_sys::OstreeRepoPruneFlags> for RepoPruneFlags {
+    fn from_glib(value: ostree_sys::OstreeRepoPruneFlags) -> Self {
         match value {
             0 => RepoPruneFlags::None,
             1 => RepoPruneFlags::NoPrune,
@@ -278,25 +359,38 @@ pub enum RepoRemoteChange {
     __Unknown(i32),
 }
 
+impl fmt::Display for RepoRemoteChange {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "RepoRemoteChange::{}", match *self {
+            RepoRemoteChange::Add => "Add",
+            RepoRemoteChange::AddIfNotExists => "AddIfNotExists",
+            RepoRemoteChange::Delete => "Delete",
+            RepoRemoteChange::DeleteIfExists => "DeleteIfExists",
+            RepoRemoteChange::Replace => "Replace",
+            _ => "Unknown",
+        })
+    }
+}
+
 #[doc(hidden)]
 impl ToGlib for RepoRemoteChange {
-    type GlibType = ffi::OstreeRepoRemoteChange;
+    type GlibType = ostree_sys::OstreeRepoRemoteChange;
 
-    fn to_glib(&self) -> ffi::OstreeRepoRemoteChange {
+    fn to_glib(&self) -> ostree_sys::OstreeRepoRemoteChange {
         match *self {
-            RepoRemoteChange::Add => ffi::OSTREE_REPO_REMOTE_CHANGE_ADD,
-            RepoRemoteChange::AddIfNotExists => ffi::OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS,
-            RepoRemoteChange::Delete => ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE,
-            RepoRemoteChange::DeleteIfExists => ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS,
-            RepoRemoteChange::Replace => ffi::OSTREE_REPO_REMOTE_CHANGE_REPLACE,
+            RepoRemoteChange::Add => ostree_sys::OSTREE_REPO_REMOTE_CHANGE_ADD,
+            RepoRemoteChange::AddIfNotExists => ostree_sys::OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS,
+            RepoRemoteChange::Delete => ostree_sys::OSTREE_REPO_REMOTE_CHANGE_DELETE,
+            RepoRemoteChange::DeleteIfExists => ostree_sys::OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS,
+            RepoRemoteChange::Replace => ostree_sys::OSTREE_REPO_REMOTE_CHANGE_REPLACE,
             RepoRemoteChange::__Unknown(value) => value
         }
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeRepoRemoteChange> for RepoRemoteChange {
-    fn from_glib(value: ffi::OstreeRepoRemoteChange) -> Self {
+impl FromGlib<ostree_sys::OstreeRepoRemoteChange> for RepoRemoteChange {
+    fn from_glib(value: ostree_sys::OstreeRepoRemoteChange) -> Self {
         match value {
             0 => RepoRemoteChange::Add,
             1 => RepoRemoteChange::AddIfNotExists,
@@ -317,22 +411,32 @@ pub enum StaticDeltaGenerateOpt {
     __Unknown(i32),
 }
 
+impl fmt::Display for StaticDeltaGenerateOpt {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "StaticDeltaGenerateOpt::{}", match *self {
+            StaticDeltaGenerateOpt::Lowlatency => "Lowlatency",
+            StaticDeltaGenerateOpt::Major => "Major",
+            _ => "Unknown",
+        })
+    }
+}
+
 #[doc(hidden)]
 impl ToGlib for StaticDeltaGenerateOpt {
-    type GlibType = ffi::OstreeStaticDeltaGenerateOpt;
+    type GlibType = ostree_sys::OstreeStaticDeltaGenerateOpt;
 
-    fn to_glib(&self) -> ffi::OstreeStaticDeltaGenerateOpt {
+    fn to_glib(&self) -> ostree_sys::OstreeStaticDeltaGenerateOpt {
         match *self {
-            StaticDeltaGenerateOpt::Lowlatency => ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY,
-            StaticDeltaGenerateOpt::Major => ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR,
+            StaticDeltaGenerateOpt::Lowlatency => ostree_sys::OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY,
+            StaticDeltaGenerateOpt::Major => ostree_sys::OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR,
             StaticDeltaGenerateOpt::__Unknown(value) => value
         }
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeStaticDeltaGenerateOpt> for StaticDeltaGenerateOpt {
-    fn from_glib(value: ffi::OstreeStaticDeltaGenerateOpt) -> Self {
+impl FromGlib<ostree_sys::OstreeStaticDeltaGenerateOpt> for StaticDeltaGenerateOpt {
+    fn from_glib(value: ostree_sys::OstreeStaticDeltaGenerateOpt) -> Self {
         match value {
             0 => StaticDeltaGenerateOpt::Lowlatency,
             1 => StaticDeltaGenerateOpt::Major,
index ea60ba833a996d4fa1025bb50c7f0f096e5b0aa3..74541aa89402a5ab933fbd3e36ae435ed899bcfc 100644 (file)
@@ -2,7 +2,6 @@
 // from gir-files (https://github.com/gtk-rs/gir-files)
 // DO NOT EDIT
 
-use ffi;
 use glib::StaticType;
 use glib::Type;
 use glib::translate::*;
@@ -10,7 +9,8 @@ use glib::value::FromValue;
 use glib::value::FromValueOptional;
 use glib::value::SetValue;
 use glib::value::Value;
-use gobject_ffi;
+use gobject_sys;
+use ostree_sys;
 
 #[cfg(any(feature = "v2015_7", feature = "dox"))]
 bitflags! {
@@ -23,17 +23,17 @@ bitflags! {
 #[cfg(any(feature = "v2015_7", feature = "dox"))]
 #[doc(hidden)]
 impl ToGlib for RepoCommitState {
-    type GlibType = ffi::OstreeRepoCommitState;
+    type GlibType = ostree_sys::OstreeRepoCommitState;
 
-    fn to_glib(&self) -> ffi::OstreeRepoCommitState {
+    fn to_glib(&self) -> ostree_sys::OstreeRepoCommitState {
         self.bits()
     }
 }
 
 #[cfg(any(feature = "v2015_7", feature = "dox"))]
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeRepoCommitState> for RepoCommitState {
-    fn from_glib(value: ffi::OstreeRepoCommitState) -> RepoCommitState {
+impl FromGlib<ostree_sys::OstreeRepoCommitState> for RepoCommitState {
+    fn from_glib(value: ostree_sys::OstreeRepoCommitState) -> RepoCommitState {
         RepoCommitState::from_bits_truncate(value)
     }
 }
@@ -49,16 +49,16 @@ bitflags! {
 
 #[doc(hidden)]
 impl ToGlib for RepoListRefsExtFlags {
-    type GlibType = ffi::OstreeRepoListRefsExtFlags;
+    type GlibType = ostree_sys::OstreeRepoListRefsExtFlags;
 
-    fn to_glib(&self) -> ffi::OstreeRepoListRefsExtFlags {
+    fn to_glib(&self) -> ostree_sys::OstreeRepoListRefsExtFlags {
         self.bits()
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeRepoListRefsExtFlags> for RepoListRefsExtFlags {
-    fn from_glib(value: ffi::OstreeRepoListRefsExtFlags) -> RepoListRefsExtFlags {
+impl FromGlib<ostree_sys::OstreeRepoListRefsExtFlags> for RepoListRefsExtFlags {
+    fn from_glib(value: ostree_sys::OstreeRepoListRefsExtFlags) -> RepoListRefsExtFlags {
         RepoListRefsExtFlags::from_bits_truncate(value)
     }
 }
@@ -76,16 +76,16 @@ bitflags! {
 
 #[doc(hidden)]
 impl ToGlib for RepoPullFlags {
-    type GlibType = ffi::OstreeRepoPullFlags;
+    type GlibType = ostree_sys::OstreeRepoPullFlags;
 
-    fn to_glib(&self) -> ffi::OstreeRepoPullFlags {
+    fn to_glib(&self) -> ostree_sys::OstreeRepoPullFlags {
         self.bits()
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeRepoPullFlags> for RepoPullFlags {
-    fn from_glib(value: ffi::OstreeRepoPullFlags) -> RepoPullFlags {
+impl FromGlib<ostree_sys::OstreeRepoPullFlags> for RepoPullFlags {
+    fn from_glib(value: ostree_sys::OstreeRepoPullFlags) -> RepoPullFlags {
         RepoPullFlags::from_bits_truncate(value)
     }
 }
@@ -99,16 +99,16 @@ bitflags! {
 
 #[doc(hidden)]
 impl ToGlib for RepoResolveRevExtFlags {
-    type GlibType = ffi::OstreeRepoResolveRevExtFlags;
+    type GlibType = ostree_sys::OstreeRepoResolveRevExtFlags;
 
-    fn to_glib(&self) -> ffi::OstreeRepoResolveRevExtFlags {
+    fn to_glib(&self) -> ostree_sys::OstreeRepoResolveRevExtFlags {
         self.bits()
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeRepoResolveRevExtFlags> for RepoResolveRevExtFlags {
-    fn from_glib(value: ffi::OstreeRepoResolveRevExtFlags) -> RepoResolveRevExtFlags {
+impl FromGlib<ostree_sys::OstreeRepoResolveRevExtFlags> for RepoResolveRevExtFlags {
+    fn from_glib(value: ostree_sys::OstreeRepoResolveRevExtFlags) -> RepoResolveRevExtFlags {
         RepoResolveRevExtFlags::from_bits_truncate(value)
     }
 }
@@ -123,16 +123,16 @@ bitflags! {
 
 #[doc(hidden)]
 impl ToGlib for SePolicyRestoreconFlags {
-    type GlibType = ffi::OstreeSePolicyRestoreconFlags;
+    type GlibType = ostree_sys::OstreeSePolicyRestoreconFlags;
 
-    fn to_glib(&self) -> ffi::OstreeSePolicyRestoreconFlags {
+    fn to_glib(&self) -> ostree_sys::OstreeSePolicyRestoreconFlags {
         self.bits()
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeSePolicyRestoreconFlags> for SePolicyRestoreconFlags {
-    fn from_glib(value: ffi::OstreeSePolicyRestoreconFlags) -> SePolicyRestoreconFlags {
+impl FromGlib<ostree_sys::OstreeSePolicyRestoreconFlags> for SePolicyRestoreconFlags {
+    fn from_glib(value: ostree_sys::OstreeSePolicyRestoreconFlags) -> SePolicyRestoreconFlags {
         SePolicyRestoreconFlags::from_bits_truncate(value)
     }
 }
@@ -150,16 +150,16 @@ bitflags! {
 
 #[doc(hidden)]
 impl ToGlib for SysrootSimpleWriteDeploymentFlags {
-    type GlibType = ffi::OstreeSysrootSimpleWriteDeploymentFlags;
+    type GlibType = ostree_sys::OstreeSysrootSimpleWriteDeploymentFlags;
 
-    fn to_glib(&self) -> ffi::OstreeSysrootSimpleWriteDeploymentFlags {
+    fn to_glib(&self) -> ostree_sys::OstreeSysrootSimpleWriteDeploymentFlags {
         self.bits()
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeSysrootSimpleWriteDeploymentFlags> for SysrootSimpleWriteDeploymentFlags {
-    fn from_glib(value: ffi::OstreeSysrootSimpleWriteDeploymentFlags) -> SysrootSimpleWriteDeploymentFlags {
+impl FromGlib<ostree_sys::OstreeSysrootSimpleWriteDeploymentFlags> for SysrootSimpleWriteDeploymentFlags {
+    fn from_glib(value: ostree_sys::OstreeSysrootSimpleWriteDeploymentFlags) -> SysrootSimpleWriteDeploymentFlags {
         SysrootSimpleWriteDeploymentFlags::from_bits_truncate(value)
     }
 }
@@ -172,23 +172,23 @@ bitflags! {
 
 #[doc(hidden)]
 impl ToGlib for SysrootUpgraderFlags {
-    type GlibType = ffi::OstreeSysrootUpgraderFlags;
+    type GlibType = ostree_sys::OstreeSysrootUpgraderFlags;
 
-    fn to_glib(&self) -> ffi::OstreeSysrootUpgraderFlags {
+    fn to_glib(&self) -> ostree_sys::OstreeSysrootUpgraderFlags {
         self.bits()
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeSysrootUpgraderFlags> for SysrootUpgraderFlags {
-    fn from_glib(value: ffi::OstreeSysrootUpgraderFlags) -> SysrootUpgraderFlags {
+impl FromGlib<ostree_sys::OstreeSysrootUpgraderFlags> for SysrootUpgraderFlags {
+    fn from_glib(value: ostree_sys::OstreeSysrootUpgraderFlags) -> SysrootUpgraderFlags {
         SysrootUpgraderFlags::from_bits_truncate(value)
     }
 }
 
 impl StaticType for SysrootUpgraderFlags {
     fn static_type() -> Type {
-        unsafe { from_glib(ffi::ostree_sysroot_upgrader_flags_get_type()) }
+        unsafe { from_glib(ostree_sys::ostree_sysroot_upgrader_flags_get_type()) }
     }
 }
 
@@ -200,13 +200,13 @@ impl<'a> FromValueOptional<'a> for SysrootUpgraderFlags {
 
 impl<'a> FromValue<'a> for SysrootUpgraderFlags {
     unsafe fn from_value(value: &Value) -> Self {
-        from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
+        from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
     }
 }
 
 impl SetValue for SysrootUpgraderFlags {
     unsafe fn set_value(value: &mut Value, this: &Self) {
-        gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
+        gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
     }
 }
 
@@ -220,16 +220,16 @@ bitflags! {
 
 #[doc(hidden)]
 impl ToGlib for SysrootUpgraderPullFlags {
-    type GlibType = ffi::OstreeSysrootUpgraderPullFlags;
+    type GlibType = ostree_sys::OstreeSysrootUpgraderPullFlags;
 
-    fn to_glib(&self) -> ffi::OstreeSysrootUpgraderPullFlags {
+    fn to_glib(&self) -> ostree_sys::OstreeSysrootUpgraderPullFlags {
         self.bits()
     }
 }
 
 #[doc(hidden)]
-impl FromGlib<ffi::OstreeSysrootUpgraderPullFlags> for SysrootUpgraderPullFlags {
-    fn from_glib(value: ffi::OstreeSysrootUpgraderPullFlags) -> SysrootUpgraderPullFlags {
+impl FromGlib<ostree_sys::OstreeSysrootUpgraderPullFlags> for SysrootUpgraderPullFlags {
+    fn from_glib(value: ostree_sys::OstreeSysrootUpgraderPullFlags) -> SysrootUpgraderPullFlags {
         SysrootUpgraderPullFlags::from_bits_truncate(value)
     }
 }
index b197a355a924d05e6bed571d690935b20ca57576..968131a21f1da989ee8d373d39f2fa96a6803aa2 100644 (file)
@@ -4,22 +4,21 @@
 
 use Error;
 use ObjectType;
-use ffi;
 use gio;
 use glib;
+use glib::GString;
 use glib::object::IsA;
 use glib::translate::*;
+use ostree_sys;
 use std::mem;
 use std::ptr;
 
 
 #[cfg(any(feature = "v2017_15", feature = "dox"))]
-pub fn break_hardlink<'a, P: Into<Option<&'a gio::Cancellable>>>(dfd: i32, path: &str, skip_xattrs: bool, cancellable: P) -> Result<(), Error> {
-    let cancellable = cancellable.into();
-    let cancellable = cancellable.to_glib_none();
+pub fn break_hardlink<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, skip_xattrs: bool, cancellable: Option<&P>) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_break_hardlink(dfd, path.to_glib_none().0, skip_xattrs.to_glib(), cancellable.0, &mut error);
+        let _ = ostree_sys::ostree_break_hardlink(dfd, path.to_glib_none().0, skip_xattrs.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
@@ -27,265 +26,243 @@ pub fn break_hardlink<'a, P: Into<Option<&'a gio::Cancellable>>>(dfd: i32, path:
 #[cfg(any(feature = "v2017_4", feature = "dox"))]
 pub fn check_version(required_year: u32, required_release: u32) -> bool {
     unsafe {
-        from_glib(ffi::ostree_check_version(required_year, required_release))
+        from_glib(ostree_sys::ostree_check_version(required_year, required_release))
     }
 }
 
 //#[cfg(any(feature = "v2016_8", feature = "dox"))]
-//pub fn checksum_b64_from_bytes(csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32) -> Option<String> {
-//    unsafe { TODO: call ffi::ostree_checksum_b64_from_bytes() }
+//pub fn checksum_b64_from_bytes(csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32) -> Option<GString> {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_b64_from_bytes() }
 //}
 
-//pub fn checksum_b64_inplace_from_bytes(csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, buf: &str) {
-//    unsafe { TODO: call ffi::ostree_checksum_b64_inplace_from_bytes() }
+//pub fn checksum_b64_inplace_from_bytes(csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, buf: &str) {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_b64_inplace_from_bytes() }
 //}
 
-//pub fn checksum_b64_inplace_to_bytes(checksum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 28 }; 32, buf: u8) {
-//    unsafe { TODO: call ffi::ostree_checksum_b64_inplace_to_bytes() }
+//pub fn checksum_b64_inplace_to_bytes(checksum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 28 }; 32, buf: u8) {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_b64_inplace_to_bytes() }
 //}
 
 //#[cfg(any(feature = "v2016_8", feature = "dox"))]
-//pub fn checksum_b64_to_bytes(checksum: &str) -> /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32 {
-//    unsafe { TODO: call ffi::ostree_checksum_b64_to_bytes() }
+//pub fn checksum_b64_to_bytes(checksum: &str) -> /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32 {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_b64_to_bytes() }
 //}
 
-//pub fn checksum_bytes_peek(bytes: &glib::Variant) -> /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32 {
-//    unsafe { TODO: call ffi::ostree_checksum_bytes_peek() }
+//pub fn checksum_bytes_peek(bytes: &glib::Variant) -> /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32 {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_bytes_peek() }
 //}
 
-//pub fn checksum_bytes_peek_validate(bytes: &glib::Variant) -> Result</*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, Error> {
-//    unsafe { TODO: call ffi::ostree_checksum_bytes_peek_validate() }
+//pub fn checksum_bytes_peek_validate(bytes: &glib::Variant) -> Result</*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, Error> {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_bytes_peek_validate() }
 //}
 
-//pub fn checksum_file<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(f: &P, objtype: ObjectType, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Q) -> Result<(), Error> {
-//    unsafe { TODO: call ffi::ostree_checksum_file() }
+//pub fn checksum_file<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(f: &P, objtype: ObjectType, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&Q>) -> Result<(), Error> {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_file() }
 //}
 
-//pub fn checksum_file_async<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>, R: /*Ignored*/gio::AsyncReadyCallback>(f: &P, objtype: ObjectType, io_priority: i32, cancellable: Q, callback: R) {
-//    unsafe { TODO: call ffi::ostree_checksum_file_async() }
+//pub fn checksum_file_async<P: IsA<gio::File>, Q: IsA<gio::Cancellable>, R: FnOnce(Result<(), Error>) + 'static>(f: &P, objtype: ObjectType, io_priority: i32, cancellable: Option<&Q>, callback: R) {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_file_async() }
 //}
 
 //#[cfg(any(feature = "v2017_13", feature = "dox"))]
-//pub fn checksum_file_at<'a, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a gio::Cancellable>>>(dfd: i32, path: &str, stbuf: P, objtype: ObjectType, flags: /*Ignored*/ChecksumFlags, out_checksum: &str, cancellable: Q) -> Result<(), Error> {
-//    unsafe { TODO: call ffi::ostree_checksum_file_at() }
+//pub fn checksum_file_at<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, stbuf: /*Unimplemented*/Option<Fundamental: Pointer>, objtype: ObjectType, flags: /*Ignored*/ChecksumFlags, out_checksum: &str, cancellable: Option<&P>) -> Result<(), Error> {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_file_at() }
 //}
 
-//pub fn checksum_file_from_input<'a, 'b, 'c, P: Into<Option<&'a glib::Variant>>, Q: IsA<gio::InputStream> + 'b, R: Into<Option<&'b Q>>, S: Into<Option<&'c gio::Cancellable>>>(file_info: &gio::FileInfo, xattrs: P, in_: R, objtype: ObjectType, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: S) -> Result<(), Error> {
-//    unsafe { TODO: call ffi::ostree_checksum_file_from_input() }
+//pub fn checksum_file_from_input<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, in_: Option<&P>, objtype: ObjectType, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&Q>) -> Result<(), Error> {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_file_from_input() }
 //}
 
-//pub fn checksum_from_bytes(csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32) -> Option<String> {
-//    unsafe { TODO: call ffi::ostree_checksum_from_bytes() }
+//pub fn checksum_from_bytes(csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32) -> Option<GString> {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_from_bytes() }
 //}
 
-pub fn checksum_from_bytes_v(csum_v: &glib::Variant) -> Option<String> {
+pub fn checksum_from_bytes_v(csum_v: &glib::Variant) -> Option<GString> {
     unsafe {
-        from_glib_full(ffi::ostree_checksum_from_bytes_v(csum_v.to_glib_none().0))
+        from_glib_full(ostree_sys::ostree_checksum_from_bytes_v(csum_v.to_glib_none().0))
     }
 }
 
-//pub fn checksum_inplace_from_bytes(csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, buf: &str) {
-//    unsafe { TODO: call ffi::ostree_checksum_inplace_from_bytes() }
+//pub fn checksum_inplace_from_bytes(csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, buf: &str) {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_inplace_from_bytes() }
 //}
 
-//pub fn checksum_to_bytes(checksum: &str) -> /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32 {
-//    unsafe { TODO: call ffi::ostree_checksum_to_bytes() }
+//pub fn checksum_to_bytes(checksum: &str) -> /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32 {
+//    unsafe { TODO: call ostree_sys:ostree_checksum_to_bytes() }
 //}
 
 pub fn checksum_to_bytes_v(checksum: &str) -> Option<glib::Variant> {
     unsafe {
-        from_glib_full(ffi::ostree_checksum_to_bytes_v(checksum.to_glib_none().0))
+        from_glib_full(ostree_sys::ostree_checksum_to_bytes_v(checksum.to_glib_none().0))
     }
 }
 
 //pub fn cmd__private__() -> /*Ignored*/Option<CmdPrivateVTable> {
-//    unsafe { TODO: call ffi::ostree_cmd__private__() }
+//    unsafe { TODO: call ostree_sys:ostree_cmd__private__() }
 //}
 
 #[cfg(any(feature = "v2018_2", feature = "dox"))]
-pub fn commit_get_content_checksum(commit_variant: &glib::Variant) -> Option<String> {
+pub fn commit_get_content_checksum(commit_variant: &glib::Variant) -> Option<GString> {
     unsafe {
-        from_glib_full(ffi::ostree_commit_get_content_checksum(commit_variant.to_glib_none().0))
+        from_glib_full(ostree_sys::ostree_commit_get_content_checksum(commit_variant.to_glib_none().0))
     }
 }
 
-pub fn commit_get_parent(commit_variant: &glib::Variant) -> Option<String> {
+pub fn commit_get_parent(commit_variant: &glib::Variant) -> Option<GString> {
     unsafe {
-        from_glib_full(ffi::ostree_commit_get_parent(commit_variant.to_glib_none().0))
+        from_glib_full(ostree_sys::ostree_commit_get_parent(commit_variant.to_glib_none().0))
     }
 }
 
 pub fn commit_get_timestamp(commit_variant: &glib::Variant) -> u64 {
     unsafe {
-        ffi::ostree_commit_get_timestamp(commit_variant.to_glib_none().0)
+        ostree_sys::ostree_commit_get_timestamp(commit_variant.to_glib_none().0)
     }
 }
 
-pub fn content_file_parse<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(compressed: bool, content_path: &P, trusted: bool, cancellable: Q) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), Error> {
-    let cancellable = cancellable.into();
-    let cancellable = cancellable.to_glib_none();
+pub fn content_file_parse<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(compressed: bool, content_path: &P, trusted: bool, cancellable: Option<&Q>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), Error> {
     unsafe {
         let mut out_input = ptr::null_mut();
         let mut out_file_info = ptr::null_mut();
         let mut out_xattrs = ptr::null_mut();
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_content_file_parse(compressed.to_glib(), content_path.to_glib_none().0, trusted.to_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.0, &mut error);
+        let _ = ostree_sys::ostree_content_file_parse(compressed.to_glib(), content_path.as_ref().to_glib_none().0, trusted.to_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
         if error.is_null() { Ok((from_glib_full(out_input), from_glib_full(out_file_info), from_glib_full(out_xattrs))) } else { Err(from_glib_full(error)) }
     }
 }
 
-pub fn content_file_parse_at<'a, P: Into<Option<&'a gio::Cancellable>>>(compressed: bool, parent_dfd: i32, path: &str, trusted: bool, cancellable: P) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), Error> {
-    let cancellable = cancellable.into();
-    let cancellable = cancellable.to_glib_none();
+pub fn content_file_parse_at<P: IsA<gio::Cancellable>>(compressed: bool, parent_dfd: i32, path: &str, trusted: bool, cancellable: Option<&P>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), Error> {
     unsafe {
         let mut out_input = ptr::null_mut();
         let mut out_file_info = ptr::null_mut();
         let mut out_xattrs = ptr::null_mut();
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_content_file_parse_at(compressed.to_glib(), parent_dfd, path.to_glib_none().0, trusted.to_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.0, &mut error);
+        let _ = ostree_sys::ostree_content_file_parse_at(compressed.to_glib(), parent_dfd, path.to_glib_none().0, trusted.to_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
         if error.is_null() { Ok((from_glib_full(out_input), from_glib_full(out_file_info), from_glib_full(out_xattrs))) } else { Err(from_glib_full(error)) }
     }
 }
 
-pub fn content_stream_parse<'a, P: IsA<gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(compressed: bool, input: &P, input_length: u64, trusted: bool, cancellable: Q) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), Error> {
-    let cancellable = cancellable.into();
-    let cancellable = cancellable.to_glib_none();
+pub fn content_stream_parse<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(compressed: bool, input: &P, input_length: u64, trusted: bool, cancellable: Option<&Q>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), Error> {
     unsafe {
         let mut out_input = ptr::null_mut();
         let mut out_file_info = ptr::null_mut();
         let mut out_xattrs = ptr::null_mut();
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_content_stream_parse(compressed.to_glib(), input.to_glib_none().0, input_length, trusted.to_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.0, &mut error);
+        let _ = ostree_sys::ostree_content_stream_parse(compressed.to_glib(), input.as_ref().to_glib_none().0, input_length, trusted.to_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
         if error.is_null() { Ok((from_glib_full(out_input), from_glib_full(out_file_info), from_glib_full(out_xattrs))) } else { Err(from_glib_full(error)) }
     }
 }
 
-pub fn create_directory_metadata<'a, P: Into<Option<&'a glib::Variant>>>(dir_info: &gio::FileInfo, xattrs: P) -> Option<glib::Variant> {
-    let xattrs = xattrs.into();
-    let xattrs = xattrs.to_glib_none();
+pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib::Variant>) -> Option<glib::Variant> {
     unsafe {
-        from_glib_full(ffi::ostree_create_directory_metadata(dir_info.to_glib_none().0, xattrs.0))
+        from_glib_full(ostree_sys::ostree_create_directory_metadata(dir_info.to_glib_none().0, xattrs.to_glib_none().0))
     }
 }
 
-//pub fn diff_dirs<'a, P: IsA<gio::File>, Q: IsA<gio::File>, R: Into<Option<&'a gio::Cancellable>>>(flags: /*Ignored*/DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 24 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, cancellable: R) -> Result<(), Error> {
-//    unsafe { TODO: call ffi::ostree_diff_dirs() }
+//pub fn diff_dirs<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: /*Ignored*/DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 24 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, cancellable: Option<&R>) -> Result<(), Error> {
+//    unsafe { TODO: call ostree_sys:ostree_diff_dirs() }
 //}
 
 //#[cfg(any(feature = "v2017_4", feature = "dox"))]
-//pub fn diff_dirs_with_options<'a, 'b, P: IsA<gio::File>, Q: IsA<gio::File>, R: Into<Option<&'a /*Ignored*/DiffDirsOptions>>, S: Into<Option<&'b gio::Cancellable>>>(flags: /*Ignored*/DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 24 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, options: R, cancellable: S) -> Result<(), Error> {
-//    unsafe { TODO: call ffi::ostree_diff_dirs_with_options() }
+//pub fn diff_dirs_with_options<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: /*Ignored*/DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 24 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, options: /*Ignored*/Option<&mut DiffDirsOptions>, cancellable: Option<&R>) -> Result<(), Error> {
+//    unsafe { TODO: call ostree_sys:ostree_diff_dirs_with_options() }
 //}
 
 //pub fn diff_print<P: IsA<gio::File>, Q: IsA<gio::File>>(a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 24 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }) {
-//    unsafe { TODO: call ffi::ostree_diff_print() }
+//    unsafe { TODO: call ostree_sys:ostree_diff_print() }
 //}
 
 //#[cfg(any(feature = "v2017_10", feature = "dox"))]
 //pub fn gpg_error_quark() -> /*Ignored*/glib::Quark {
-//    unsafe { TODO: call ffi::ostree_gpg_error_quark() }
+//    unsafe { TODO: call ostree_sys:ostree_gpg_error_quark() }
 //}
 
-//pub fn hash_object_name<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(a: P) -> u32 {
-//    unsafe { TODO: call ffi::ostree_hash_object_name() }
+//pub fn hash_object_name(a: /*Unimplemented*/Option<Fundamental: Pointer>) -> u32 {
+//    unsafe { TODO: call ostree_sys:ostree_hash_object_name() }
 //}
 
 //pub fn metadata_variant_type(objtype: ObjectType) -> /*Ignored*/Option<glib::VariantType> {
-//    unsafe { TODO: call ffi::ostree_metadata_variant_type() }
+//    unsafe { TODO: call ostree_sys:ostree_metadata_variant_type() }
 //}
 
-pub fn object_from_string(str: &str) -> (String, ObjectType) {
+pub fn object_from_string(str: &str) -> (GString, ObjectType) {
     unsafe {
         let mut out_checksum = ptr::null_mut();
         let mut out_objtype = mem::uninitialized();
-        ffi::ostree_object_from_string(str.to_glib_none().0, &mut out_checksum, &mut out_objtype);
+        ostree_sys::ostree_object_from_string(str.to_glib_none().0, &mut out_checksum, &mut out_objtype);
         (from_glib_full(out_checksum), from_glib(out_objtype))
     }
 }
 
-pub fn object_name_deserialize(variant: &glib::Variant) -> (String, ObjectType) {
+pub fn object_name_deserialize(variant: &glib::Variant) -> (GString, ObjectType) {
     unsafe {
         let mut out_checksum = ptr::null();
         let mut out_objtype = mem::uninitialized();
-        ffi::ostree_object_name_deserialize(variant.to_glib_none().0, &mut out_checksum, &mut out_objtype);
+        ostree_sys::ostree_object_name_deserialize(variant.to_glib_none().0, &mut out_checksum, &mut out_objtype);
         (from_glib_none(out_checksum), from_glib(out_objtype))
     }
 }
 
 pub fn object_name_serialize(checksum: &str, objtype: ObjectType) -> Option<glib::Variant> {
     unsafe {
-        from_glib_none(ffi::ostree_object_name_serialize(checksum.to_glib_none().0, objtype.to_glib()))
+        from_glib_none(ostree_sys::ostree_object_name_serialize(checksum.to_glib_none().0, objtype.to_glib()))
     }
 }
 
-pub fn object_to_string(checksum: &str, objtype: ObjectType) -> Option<String> {
+pub fn object_to_string(checksum: &str, objtype: ObjectType) -> Option<GString> {
     unsafe {
-        from_glib_full(ffi::ostree_object_to_string(checksum.to_glib_none().0, objtype.to_glib()))
+        from_glib_full(ostree_sys::ostree_object_to_string(checksum.to_glib_none().0, objtype.to_glib()))
     }
 }
 
 pub fn object_type_from_string(str: &str) -> ObjectType {
     unsafe {
-        from_glib(ffi::ostree_object_type_from_string(str.to_glib_none().0))
+        from_glib(ostree_sys::ostree_object_type_from_string(str.to_glib_none().0))
     }
 }
 
-pub fn object_type_to_string(objtype: ObjectType) -> Option<String> {
+pub fn object_type_to_string(objtype: ObjectType) -> Option<GString> {
     unsafe {
-        from_glib_none(ffi::ostree_object_type_to_string(objtype.to_glib()))
+        from_glib_none(ostree_sys::ostree_object_type_to_string(objtype.to_glib()))
     }
 }
 
-pub fn parse_refspec(refspec: &str) -> Result<(Option<String>, String), Error> {
+pub fn parse_refspec(refspec: &str) -> Result<(Option<GString>, GString), Error> {
     unsafe {
         let mut out_remote = ptr::null_mut();
         let mut out_ref = ptr::null_mut();
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_parse_refspec(refspec.to_glib_none().0, &mut out_remote, &mut out_ref, &mut error);
+        let _ = ostree_sys::ostree_parse_refspec(refspec.to_glib_none().0, &mut out_remote, &mut out_ref, &mut error);
         if error.is_null() { Ok((from_glib_full(out_remote), from_glib_full(out_ref))) } else { Err(from_glib_full(error)) }
     }
 }
 
 #[cfg(any(feature = "v2016_6", feature = "dox"))]
-pub fn raw_file_to_archive_z2_stream<'a, 'b, P: IsA<gio::InputStream>, Q: Into<Option<&'a glib::Variant>>, R: Into<Option<&'b gio::Cancellable>>>(input: &P, file_info: &gio::FileInfo, xattrs: Q, cancellable: R) -> Result<gio::InputStream, Error> {
-    let xattrs = xattrs.into();
-    let xattrs = xattrs.to_glib_none();
-    let cancellable = cancellable.into();
-    let cancellable = cancellable.to_glib_none();
+pub fn raw_file_to_archive_z2_stream<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<gio::InputStream, Error> {
     unsafe {
         let mut out_input = ptr::null_mut();
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_raw_file_to_archive_z2_stream(input.to_glib_none().0, file_info.to_glib_none().0, xattrs.0, &mut out_input, cancellable.0, &mut error);
+        let _ = ostree_sys::ostree_raw_file_to_archive_z2_stream(input.as_ref().to_glib_none().0, file_info.to_glib_none().0, xattrs.to_glib_none().0, &mut out_input, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
         if error.is_null() { Ok(from_glib_full(out_input)) } else { Err(from_glib_full(error)) }
     }
 }
 
 #[cfg(any(feature = "v2017_3", feature = "dox"))]
-pub fn raw_file_to_archive_z2_stream_with_options<'a, 'b, 'c, P: IsA<gio::InputStream>, Q: Into<Option<&'a glib::Variant>>, R: Into<Option<&'b glib::Variant>>, S: Into<Option<&'c gio::Cancellable>>>(input: &P, file_info: &gio::FileInfo, xattrs: Q, options: R, cancellable: S) -> Result<gio::InputStream, Error> {
-    let xattrs = xattrs.into();
-    let xattrs = xattrs.to_glib_none();
-    let options = options.into();
-    let options = options.to_glib_none();
-    let cancellable = cancellable.into();
-    let cancellable = cancellable.to_glib_none();
+pub fn raw_file_to_archive_z2_stream_with_options<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, options: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<gio::InputStream, Error> {
     unsafe {
         let mut out_input = ptr::null_mut();
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_raw_file_to_archive_z2_stream_with_options(input.to_glib_none().0, file_info.to_glib_none().0, xattrs.0, options.0, &mut out_input, cancellable.0, &mut error);
+        let _ = ostree_sys::ostree_raw_file_to_archive_z2_stream_with_options(input.as_ref().to_glib_none().0, file_info.to_glib_none().0, xattrs.to_glib_none().0, options.to_glib_none().0, &mut out_input, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
         if error.is_null() { Ok(from_glib_full(out_input)) } else { Err(from_glib_full(error)) }
     }
 }
 
-pub fn raw_file_to_content_stream<'a, 'b, P: IsA<gio::InputStream>, Q: Into<Option<&'a glib::Variant>>, R: Into<Option<&'b gio::Cancellable>>>(input: &P, file_info: &gio::FileInfo, xattrs: Q, cancellable: R) -> Result<(gio::InputStream, u64), Error> {
-    let xattrs = xattrs.into();
-    let xattrs = xattrs.to_glib_none();
-    let cancellable = cancellable.into();
-    let cancellable = cancellable.to_glib_none();
+pub fn raw_file_to_content_stream<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<(gio::InputStream, u64), Error> {
     unsafe {
         let mut out_input = ptr::null_mut();
         let mut out_length = mem::uninitialized();
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_raw_file_to_content_stream(input.to_glib_none().0, file_info.to_glib_none().0, xattrs.0, &mut out_input, &mut out_length, cancellable.0, &mut error);
+        let _ = ostree_sys::ostree_raw_file_to_content_stream(input.as_ref().to_glib_none().0, file_info.to_glib_none().0, xattrs.to_glib_none().0, &mut out_input, &mut out_length, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
         if error.is_null() { Ok((from_glib_full(out_input), out_length)) } else { Err(from_glib_full(error)) }
     }
 }
@@ -293,18 +270,16 @@ pub fn raw_file_to_content_stream<'a, 'b, P: IsA<gio::InputStream>, Q: Into<Opti
 pub fn validate_checksum_string(sha256: &str) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_validate_checksum_string(sha256.to_glib_none().0, &mut error);
+        let _ = ostree_sys::ostree_validate_checksum_string(sha256.to_glib_none().0, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
 
 #[cfg(any(feature = "v2018_6", feature = "dox"))]
-pub fn validate_collection_id<'a, P: Into<Option<&'a str>>>(collection_id: P) -> Result<(), Error> {
-    let collection_id = collection_id.into();
-    let collection_id = collection_id.to_glib_none();
+pub fn validate_collection_id(collection_id: Option<&str>) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_validate_collection_id(collection_id.0, &mut error);
+        let _ = ostree_sys::ostree_validate_collection_id(collection_id.to_glib_none().0, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
@@ -313,7 +288,7 @@ pub fn validate_collection_id<'a, P: Into<Option<&'a str>>>(collection_id: P) ->
 pub fn validate_remote_name(remote_name: &str) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_validate_remote_name(remote_name.to_glib_none().0, &mut error);
+        let _ = ostree_sys::ostree_validate_remote_name(remote_name.to_glib_none().0, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
@@ -321,7 +296,7 @@ pub fn validate_remote_name(remote_name: &str) -> Result<(), Error> {
 pub fn validate_rev(rev: &str) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_validate_rev(rev.to_glib_none().0, &mut error);
+        let _ = ostree_sys::ostree_validate_rev(rev.to_glib_none().0, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
@@ -329,7 +304,7 @@ pub fn validate_rev(rev: &str) -> Result<(), Error> {
 pub fn validate_structureof_checksum_string(checksum: &str) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_validate_structureof_checksum_string(checksum.to_glib_none().0, &mut error);
+        let _ = ostree_sys::ostree_validate_structureof_checksum_string(checksum.to_glib_none().0, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
@@ -337,7 +312,7 @@ pub fn validate_structureof_checksum_string(checksum: &str) -> Result<(), Error>
 pub fn validate_structureof_commit(commit: &glib::Variant) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_validate_structureof_commit(commit.to_glib_none().0, &mut error);
+        let _ = ostree_sys::ostree_validate_structureof_commit(commit.to_glib_none().0, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
@@ -345,7 +320,7 @@ pub fn validate_structureof_commit(commit: &glib::Variant) -> Result<(), Error>
 pub fn validate_structureof_csum_v(checksum: &glib::Variant) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_validate_structureof_csum_v(checksum.to_glib_none().0, &mut error);
+        let _ = ostree_sys::ostree_validate_structureof_csum_v(checksum.to_glib_none().0, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
@@ -353,7 +328,7 @@ pub fn validate_structureof_csum_v(checksum: &glib::Variant) -> Result<(), Error
 pub fn validate_structureof_dirmeta(dirmeta: &glib::Variant) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_validate_structureof_dirmeta(dirmeta.to_glib_none().0, &mut error);
+        let _ = ostree_sys::ostree_validate_structureof_dirmeta(dirmeta.to_glib_none().0, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
@@ -361,7 +336,7 @@ pub fn validate_structureof_dirmeta(dirmeta: &glib::Variant) -> Result<(), Error
 pub fn validate_structureof_dirtree(dirtree: &glib::Variant) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_validate_structureof_dirtree(dirtree.to_glib_none().0, &mut error);
+        let _ = ostree_sys::ostree_validate_structureof_dirtree(dirtree.to_glib_none().0, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
@@ -369,7 +344,7 @@ pub fn validate_structureof_dirtree(dirtree: &glib::Variant) -> Result<(), Error
 pub fn validate_structureof_file_mode(mode: u32) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_validate_structureof_file_mode(mode, &mut error);
+        let _ = ostree_sys::ostree_validate_structureof_file_mode(mode, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
@@ -377,7 +352,7 @@ pub fn validate_structureof_file_mode(mode: u32) -> Result<(), Error> {
 pub fn validate_structureof_objtype(objtype: u8) -> Result<(), Error> {
     unsafe {
         let mut error = ptr::null_mut();
-        let _ = ffi::ostree_validate_structureof_objtype(objtype, &mut error);
+        let _ = ostree_sys::ostree_validate_structureof_objtype(objtype, &mut error);
         if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
     }
 }
index 0f29e26db339d67cd93fcc7a670ad0a18ac4cb2b..515f74dc3708e94bf50e2d3bfbe007872c86e519 100644 (file)
@@ -5,95 +5,77 @@
 #[cfg(any(feature = "v2016_6", feature = "dox"))]
 use Error;
 use GpgSignatureFormatFlags;
-use ffi;
 use glib;
-use glib::object::IsA;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
+use ostree_sys;
+use std::fmt;
 use std::mem;
+#[cfg(any(feature = "v2016_6", feature = "dox"))]
 use std::ptr;
 
 glib_wrapper! {
-    pub struct GpgVerifyResult(Object<ffi::OstreeGpgVerifyResult>);
+    pub struct GpgVerifyResult(Object<ostree_sys::OstreeGpgVerifyResult, GpgVerifyResultClass>);
 
     match fn {
-        get_type => || ffi::ostree_gpg_verify_result_get_type(),
+        get_type => || ostree_sys::ostree_gpg_verify_result_get_type(),
     }
 }
 
 impl GpgVerifyResult {
-    pub fn describe_variant<'a, P: Into<Option<&'a str>>>(variant: &glib::Variant, output_buffer: &mut glib::String, line_prefix: P, flags: GpgSignatureFormatFlags) {
-        let line_prefix = line_prefix.into();
-        let line_prefix = line_prefix.to_glib_none();
-        unsafe {
-            ffi::ostree_gpg_verify_result_describe_variant(variant.to_glib_none().0, output_buffer.to_glib_none_mut().0, line_prefix.0, flags.to_glib());
-        }
-    }
-}
-
-pub trait GpgVerifyResultExt {
-    fn count_all(&self) -> u32;
-
-    fn count_valid(&self) -> u32;
-
-    fn describe<'a, P: Into<Option<&'a str>>>(&self, signature_index: u32, output_buffer: &mut glib::String, line_prefix: P, flags: GpgSignatureFormatFlags);
-
-    //fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 26 }) -> Option<glib::Variant>;
-
-    fn get_all(&self, signature_index: u32) -> Option<glib::Variant>;
-
-    fn lookup(&self, key_id: &str) -> Option<u32>;
-
-    #[cfg(any(feature = "v2016_6", feature = "dox"))]
-    fn require_valid_signature(&self) -> Result<(), Error>;
-}
-
-impl<O: IsA<GpgVerifyResult>> GpgVerifyResultExt for O {
-    fn count_all(&self) -> u32 {
+    pub fn count_all(&self) -> u32 {
         unsafe {
-            ffi::ostree_gpg_verify_result_count_all(self.to_glib_none().0)
+            ostree_sys::ostree_gpg_verify_result_count_all(self.to_glib_none().0)
         }
     }
 
-    fn count_valid(&self) -> u32 {
+    pub fn count_valid(&self) -> u32 {
         unsafe {
-            ffi::ostree_gpg_verify_result_count_valid(self.to_glib_none().0)
+            ostree_sys::ostree_gpg_verify_result_count_valid(self.to_glib_none().0)
         }
     }
 
-    fn describe<'a, P: Into<Option<&'a str>>>(&self, signature_index: u32, output_buffer: &mut glib::String, line_prefix: P, flags: GpgSignatureFormatFlags) {
-        let line_prefix = line_prefix.into();
-        let line_prefix = line_prefix.to_glib_none();
+    pub fn describe(&self, signature_index: u32, output_buffer: &mut glib::String, line_prefix: Option<&str>, flags: GpgSignatureFormatFlags) {
         unsafe {
-            ffi::ostree_gpg_verify_result_describe(self.to_glib_none().0, signature_index, output_buffer.to_glib_none_mut().0, line_prefix.0, flags.to_glib());
+            ostree_sys::ostree_gpg_verify_result_describe(self.to_glib_none().0, signature_index, output_buffer.to_glib_none_mut().0, line_prefix.to_glib_none().0, flags.to_glib());
         }
     }
 
-    //fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 26 }) -> Option<glib::Variant> {
-    //    unsafe { TODO: call ffi::ostree_gpg_verify_result_get() }
+    //pub fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 26 }) -> Option<glib::Variant> {
+    //    unsafe { TODO: call ostree_sys:ostree_gpg_verify_result_get() }
     //}
 
-    fn get_all(&self, signature_index: u32) -> Option<glib::Variant> {
+    pub fn get_all(&self, signature_index: u32) -> Option<glib::Variant> {
         unsafe {
-            from_glib_full(ffi::ostree_gpg_verify_result_get_all(self.to_glib_none().0, signature_index))
+            from_glib_full(ostree_sys::ostree_gpg_verify_result_get_all(self.to_glib_none().0, signature_index))
         }
     }
 
-    fn lookup(&self, key_id: &str) -> Option<u32> {
+    pub fn lookup(&self, key_id: &str) -> Option<u32> {
         unsafe {
             let mut out_signature_index = mem::uninitialized();
-            let ret = from_glib(ffi::ostree_gpg_verify_result_lookup(self.to_glib_none().0, key_id.to_glib_none().0, &mut out_signature_index));
+            let ret = from_glib(ostree_sys::ostree_gpg_verify_result_lookup(self.to_glib_none().0, key_id.to_glib_none().0, &mut out_signature_index));
             if ret { Some(out_signature_index) } else { None }
         }
     }
 
     #[cfg(any(feature = "v2016_6", feature = "dox"))]
-    fn require_valid_signature(&self) -> Result<(), Error> {
+    pub fn require_valid_signature(&self) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_gpg_verify_result_require_valid_signature(self.to_glib_none().0, &mut error);
+            let _ = ostree_sys::ostree_gpg_verify_result_require_valid_signature(self.to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
+
+    pub fn describe_variant(variant: &glib::Variant, output_buffer: &mut glib::String, line_prefix: Option<&str>, flags: GpgSignatureFormatFlags) {
+        unsafe {
+            ostree_sys::ostree_gpg_verify_result_describe_variant(variant.to_glib_none().0, output_buffer.to_glib_none_mut().0, line_prefix.to_glib_none().0, flags.to_glib());
+        }
+    }
+}
+
+impl fmt::Display for GpgVerifyResult {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "GpgVerifyResult")
+    }
 }
index f6d31a392d58d3d8aad968ac6c80346507e99cb5..9afc9d784edf140d08f46372fecd6844618a5514 100644 (file)
@@ -3,44 +3,37 @@
 // DO NOT EDIT
 
 mod async_progress;
-pub use self::async_progress::AsyncProgress;
+pub use self::async_progress::{AsyncProgress, AsyncProgressClass, NONE_ASYNC_PROGRESS};
 pub use self::async_progress::AsyncProgressExt;
 
 mod bootconfig_parser;
-pub use self::bootconfig_parser::BootconfigParser;
-pub use self::bootconfig_parser::BootconfigParserExt;
+pub use self::bootconfig_parser::{BootconfigParser, BootconfigParserClass};
 
 mod deployment;
-pub use self::deployment::Deployment;
-pub use self::deployment::DeploymentExt;
+pub use self::deployment::{Deployment, DeploymentClass};
 
 mod gpg_verify_result;
-pub use self::gpg_verify_result::GpgVerifyResult;
-pub use self::gpg_verify_result::GpgVerifyResultExt;
+pub use self::gpg_verify_result::{GpgVerifyResult, GpgVerifyResultClass};
 
 mod mutable_tree;
-pub use self::mutable_tree::MutableTree;
+pub use self::mutable_tree::{MutableTree, MutableTreeClass, NONE_MUTABLE_TREE};
 pub use self::mutable_tree::MutableTreeExt;
 
 mod repo;
-pub use self::repo::Repo;
-pub use self::repo::RepoExt;
+pub use self::repo::{Repo, RepoClass};
 
 mod repo_file;
-pub use self::repo_file::RepoFile;
+pub use self::repo_file::{RepoFile, RepoFileClass, NONE_REPO_FILE};
 pub use self::repo_file::RepoFileExt;
 
 mod se_policy;
-pub use self::se_policy::SePolicy;
-pub use self::se_policy::SePolicyExt;
+pub use self::se_policy::{SePolicy, SePolicyClass};
 
 mod sysroot;
-pub use self::sysroot::Sysroot;
-pub use self::sysroot::SysrootExt;
+pub use self::sysroot::{Sysroot, SysrootClass};
 
 mod sysroot_upgrader;
-pub use self::sysroot_upgrader::SysrootUpgrader;
-pub use self::sysroot_upgrader::SysrootUpgraderExt;
+pub use self::sysroot_upgrader::{SysrootUpgrader, SysrootUpgraderClass};
 
 #[cfg(any(feature = "v2018_6", feature = "dox"))]
 mod remote;
@@ -109,13 +102,6 @@ pub use self::constants::TREE_GVARIANT_STRING;
 #[doc(hidden)]
 pub mod traits {
     pub use super::AsyncProgressExt;
-    pub use super::BootconfigParserExt;
-    pub use super::DeploymentExt;
-    pub use super::GpgVerifyResultExt;
     pub use super::MutableTreeExt;
-    pub use super::RepoExt;
     pub use super::RepoFileExt;
-    pub use super::SePolicyExt;
-    pub use super::SysrootExt;
-    pub use super::SysrootUpgraderExt;
 }
index 0844fc813501a4c7758137a24f752ee1fe6690c3..57acdbae3b7b3a6ba859debf24296458b787f865 100644 (file)
@@ -5,33 +5,32 @@
 use Error;
 #[cfg(any(feature = "v2018_7", feature = "dox"))]
 use Repo;
-use ffi;
+use glib::GString;
 use glib::object::IsA;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
-use std::mem;
+use ostree_sys;
+use std::fmt;
 use std::ptr;
 
 glib_wrapper! {
-    pub struct MutableTree(Object<ffi::OstreeMutableTree, ffi::OstreeMutableTreeClass>);
+    pub struct MutableTree(Object<ostree_sys::OstreeMutableTree, ostree_sys::OstreeMutableTreeClass, MutableTreeClass>);
 
     match fn {
-        get_type => || ffi::ostree_mutable_tree_get_type(),
+        get_type => || ostree_sys::ostree_mutable_tree_get_type(),
     }
 }
 
 impl MutableTree {
     pub fn new() -> MutableTree {
         unsafe {
-            from_glib_full(ffi::ostree_mutable_tree_new())
+            from_glib_full(ostree_sys::ostree_mutable_tree_new())
         }
     }
 
     #[cfg(any(feature = "v2018_7", feature = "dox"))]
     pub fn new_from_checksum(repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> MutableTree {
         unsafe {
-            from_glib_full(ffi::ostree_mutable_tree_new_from_checksum(repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_mutable_tree_new_from_checksum(repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0))
         }
     }
 }
@@ -42,7 +41,9 @@ impl Default for MutableTree {
     }
 }
 
-pub trait MutableTreeExt {
+pub const NONE_MUTABLE_TREE: Option<&MutableTree> = None;
+
+pub trait MutableTreeExt: 'static {
     #[cfg(any(feature = "v2018_7", feature = "dox"))]
     fn check_error(&self) -> Result<(), Error>;
 
@@ -53,15 +54,15 @@ pub trait MutableTreeExt {
     #[cfg(any(feature = "v2018_7", feature = "dox"))]
     fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool;
 
-    fn get_contents_checksum(&self) -> Option<String>;
+    fn get_contents_checksum(&self) -> Option<GString>;
 
     //fn get_files(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 };
 
-    fn get_metadata_checksum(&self) -> Option<String>;
+    fn get_metadata_checksum(&self) -> Option<GString>;
 
     //fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 37 };
 
-    fn lookup(&self, name: &str) -> Result<(String, MutableTree), Error>;
+    fn lookup(&self, name: &str) -> Result<(GString, MutableTree), Error>;
 
     #[cfg(any(feature = "v2018_9", feature = "dox"))]
     fn remove(&self, name: &str, allow_noent: bool) -> Result<(), Error>;
@@ -80,7 +81,7 @@ impl<O: IsA<MutableTree>> MutableTreeExt for O {
     fn check_error(&self) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_mutable_tree_check_error(self.to_glib_none().0, &mut error);
+            let _ = ostree_sys::ostree_mutable_tree_check_error(self.as_ref().to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
@@ -89,48 +90,48 @@ impl<O: IsA<MutableTree>> MutableTreeExt for O {
         unsafe {
             let mut out_subdir = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_mutable_tree_ensure_dir(self.to_glib_none().0, name.to_glib_none().0, &mut out_subdir, &mut error);
+            let _ = ostree_sys::ostree_mutable_tree_ensure_dir(self.as_ref().to_glib_none().0, name.to_glib_none().0, &mut out_subdir, &mut error);
             if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) }
         }
     }
 
     //fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result<MutableTree, Error> {
-    //    unsafe { TODO: call ffi::ostree_mutable_tree_ensure_parent_dirs() }
+    //    unsafe { TODO: call ostree_sys:ostree_mutable_tree_ensure_parent_dirs() }
     //}
 
     #[cfg(any(feature = "v2018_7", feature = "dox"))]
     fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool {
         unsafe {
-            from_glib(ffi::ostree_mutable_tree_fill_empty_from_dirtree(self.to_glib_none().0, repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0))
+            from_glib(ostree_sys::ostree_mutable_tree_fill_empty_from_dirtree(self.as_ref().to_glib_none().0, repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0))
         }
     }
 
-    fn get_contents_checksum(&self) -> Option<String> {
+    fn get_contents_checksum(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_mutable_tree_get_contents_checksum(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_mutable_tree_get_contents_checksum(self.as_ref().to_glib_none().0))
         }
     }
 
     //fn get_files(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 } {
-    //    unsafe { TODO: call ffi::ostree_mutable_tree_get_files() }
+    //    unsafe { TODO: call ostree_sys:ostree_mutable_tree_get_files() }
     //}
 
-    fn get_metadata_checksum(&self) -> Option<String> {
+    fn get_metadata_checksum(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_mutable_tree_get_metadata_checksum(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_mutable_tree_get_metadata_checksum(self.as_ref().to_glib_none().0))
         }
     }
 
     //fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 37 } {
-    //    unsafe { TODO: call ffi::ostree_mutable_tree_get_subdirs() }
+    //    unsafe { TODO: call ostree_sys:ostree_mutable_tree_get_subdirs() }
     //}
 
-    fn lookup(&self, name: &str) -> Result<(String, MutableTree), Error> {
+    fn lookup(&self, name: &str) -> Result<(GString, MutableTree), Error> {
         unsafe {
             let mut out_file_checksum = ptr::null_mut();
             let mut out_subdir = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_mutable_tree_lookup(self.to_glib_none().0, name.to_glib_none().0, &mut out_file_checksum, &mut out_subdir, &mut error);
+            let _ = ostree_sys::ostree_mutable_tree_lookup(self.as_ref().to_glib_none().0, name.to_glib_none().0, &mut out_file_checksum, &mut out_subdir, &mut error);
             if error.is_null() { Ok((from_glib_full(out_file_checksum), from_glib_full(out_subdir))) } else { Err(from_glib_full(error)) }
         }
     }
@@ -139,7 +140,7 @@ impl<O: IsA<MutableTree>> MutableTreeExt for O {
     fn remove(&self, name: &str, allow_noent: bool) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_mutable_tree_remove(self.to_glib_none().0, name.to_glib_none().0, allow_noent.to_glib(), &mut error);
+            let _ = ostree_sys::ostree_mutable_tree_remove(self.as_ref().to_glib_none().0, name.to_glib_none().0, allow_noent.to_glib(), &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
@@ -147,24 +148,30 @@ impl<O: IsA<MutableTree>> MutableTreeExt for O {
     fn replace_file(&self, name: &str, checksum: &str) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_mutable_tree_replace_file(self.to_glib_none().0, name.to_glib_none().0, checksum.to_glib_none().0, &mut error);
+            let _ = ostree_sys::ostree_mutable_tree_replace_file(self.as_ref().to_glib_none().0, name.to_glib_none().0, checksum.to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     fn set_contents_checksum(&self, checksum: &str) {
         unsafe {
-            ffi::ostree_mutable_tree_set_contents_checksum(self.to_glib_none().0, checksum.to_glib_none().0);
+            ostree_sys::ostree_mutable_tree_set_contents_checksum(self.as_ref().to_glib_none().0, checksum.to_glib_none().0);
         }
     }
 
     fn set_metadata_checksum(&self, checksum: &str) {
         unsafe {
-            ffi::ostree_mutable_tree_set_metadata_checksum(self.to_glib_none().0, checksum.to_glib_none().0);
+            ostree_sys::ostree_mutable_tree_set_metadata_checksum(self.as_ref().to_glib_none().0, checksum.to_glib_none().0);
         }
     }
 
     //fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result<MutableTree, Error> {
-    //    unsafe { TODO: call ffi::ostree_mutable_tree_walk() }
+    //    unsafe { TODO: call ostree_sys:ostree_mutable_tree_walk() }
     //}
 }
+
+impl fmt::Display for MutableTree {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "MutableTree")
+    }
+}
index c887c456eaa78beebeb9f4775a5dc9da05d0c304..3933985fcd9047a8fd36ec8a2d90999bae74769c 100644 (file)
@@ -2,36 +2,35 @@
 // from gir-files (https://github.com/gtk-rs/gir-files)
 // DO NOT EDIT
 
-use ffi;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use glib::GString;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
-use std::mem;
-use std::ptr;
+use ostree_sys;
 
 glib_wrapper! {
     #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
-    pub struct Remote(Shared<ffi::OstreeRemote>);
+    pub struct Remote(Shared<ostree_sys::OstreeRemote>);
 
     match fn {
-        ref => |ptr| ffi::ostree_remote_ref(ptr),
-        unref => |ptr| ffi::ostree_remote_unref(ptr),
-        get_type => || ffi::ostree_remote_get_type(),
+        ref => |ptr| ostree_sys::ostree_remote_ref(ptr),
+        unref => |ptr| ostree_sys::ostree_remote_unref(ptr),
+        get_type => || ostree_sys::ostree_remote_get_type(),
     }
 }
 
 impl Remote {
     #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    pub fn get_name(&self) -> Option<String> {
+    pub fn get_name(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_remote_get_name(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_remote_get_name(self.to_glib_none().0))
         }
     }
 
     #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    pub fn get_url(&self) -> Option<String> {
+    pub fn get_url(&self) -> Option<GString> {
         unsafe {
-            from_glib_full(ffi::ostree_remote_get_url(self.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_remote_get_url(self.to_glib_none().0))
         }
     }
 }
index aa743049fd173a6ad4fad03bceac2306f3d94d5a..5753124389f8b713722adddd2c7c6aa0a8f0c531 100644 (file)
@@ -25,1444 +25,978 @@ use RepoRemoteChange;
 use RepoResolveRevExtFlags;
 use RepoTransactionStats;
 use StaticDeltaGenerateOpt;
-use ffi;
 use gio;
 use glib;
+use glib::GString;
 use glib::StaticType;
 use glib::Value;
-use glib::object::Downcast;
 use glib::object::IsA;
+use glib::object::ObjectType as _;
 use glib::signal::SignalHandlerId;
-use glib::signal::connect;
+use glib::signal::connect_raw;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
+use glib_sys;
+use gobject_sys;
 use libc;
+use ostree_sys;
 use std::boxed::Box as Box_;
+use std::fmt;
 use std::mem;
 use std::mem::transmute;
 use std::ptr;
 
 glib_wrapper! {
-    pub struct Repo(Object<ffi::OstreeRepo>);
+    pub struct Repo(Object<ostree_sys::OstreeRepo, RepoClass>);
 
     match fn {
-        get_type => || ffi::ostree_repo_get_type(),
+        get_type => || ostree_sys::ostree_repo_get_type(),
     }
 }
 
 impl Repo {
     pub fn new<P: IsA<gio::File>>(path: &P) -> Repo {
         unsafe {
-            from_glib_full(ffi::ostree_repo_new(path.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_repo_new(path.as_ref().to_glib_none().0))
         }
     }
 
     pub fn new_default() -> Repo {
         unsafe {
-            from_glib_full(ffi::ostree_repo_new_default())
+            from_glib_full(ostree_sys::ostree_repo_new_default())
         }
     }
 
     pub fn new_for_sysroot_path<P: IsA<gio::File>, Q: IsA<gio::File>>(repo_path: &P, sysroot_path: &Q) -> Repo {
         unsafe {
-            from_glib_full(ffi::ostree_repo_new_for_sysroot_path(repo_path.to_glib_none().0, sysroot_path.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_repo_new_for_sysroot_path(repo_path.as_ref().to_glib_none().0, sysroot_path.as_ref().to_glib_none().0))
         }
     }
 
-    #[cfg(any(feature = "v2017_10", feature = "dox"))]
-    pub fn create_at<'a, P: Into<Option<&'a gio::Cancellable>>>(dfd: i32, path: &str, mode: RepoMode, options: &glib::Variant, cancellable: P) -> Result<Repo, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
-        unsafe {
-            let mut error = ptr::null_mut();
-            let ret = ffi::ostree_repo_create_at(dfd, path.to_glib_none().0, mode.to_glib(), options.to_glib_none().0, cancellable.0, &mut error);
-            if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
-        }
-    }
-
-    pub fn mode_from_string(mode: &str) -> Result<RepoMode, Error> {
-        unsafe {
-            let mut out_mode = mem::uninitialized();
-            let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_mode_from_string(mode.to_glib_none().0, &mut out_mode, &mut error);
-            if error.is_null() { Ok(from_glib(out_mode)) } else { Err(from_glib_full(error)) }
-        }
-    }
-
-    #[cfg(any(feature = "v2017_10", feature = "dox"))]
-    pub fn open_at<'a, P: Into<Option<&'a gio::Cancellable>>>(dfd: i32, path: &str, cancellable: P) -> Result<Repo, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
-        unsafe {
-            let mut error = ptr::null_mut();
-            let ret = ffi::ostree_repo_open_at(dfd, path.to_glib_none().0, cancellable.0, &mut error);
-            if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
-        }
-    }
-
-    //pub fn pull_default_console_progress_changed<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(progress: &AsyncProgress, user_data: P) {
-    //    unsafe { TODO: call ffi::ostree_repo_pull_default_console_progress_changed() }
-    //}
-
-    //#[cfg(any(feature = "v2018_5", feature = "dox"))]
-    //pub fn traverse_new_parents() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 } {
-    //    unsafe { TODO: call ffi::ostree_repo_traverse_new_parents() }
-    //}
-
-    //pub fn traverse_new_reachable() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 } {
-    //    unsafe { TODO: call ffi::ostree_repo_traverse_new_reachable() }
-    //}
-
-    //#[cfg(any(feature = "v2018_5", feature = "dox"))]
-    //pub fn traverse_parents_get_commits(parents: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, object: &glib::Variant) -> Vec<String> {
-    //    unsafe { TODO: call ffi::ostree_repo_traverse_parents_get_commits() }
-    //}
-}
-
-pub trait RepoExt {
-    fn abort_transaction<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
-
-    fn add_gpg_signature_summary<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, key_id: &[&str], homedir: P, cancellable: Q) -> Result<(), Error>;
-
-    fn append_gpg_signature<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, signature_bytes: &glib::Bytes, cancellable: P) -> Result<(), Error>;
-
-    //#[cfg(any(feature = "v2016_8", feature = "dox"))]
-    //fn checkout_at<'a, 'b, P: Into<Option<&'a /*Ignored*/RepoCheckoutAtOptions>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error>;
-
-    fn checkout_gc<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
-
-    fn checkout_tree<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, mode: RepoCheckoutMode, overwrite_mode: RepoCheckoutOverwriteMode, destination: &P, source: &RepoFile, source_info: &gio::FileInfo, cancellable: Q) -> Result<(), Error>;
-
-    //fn checkout_tree_at<'a, 'b, P: Into<Option<&'a /*Ignored*/RepoCheckoutOptions>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error>;
-
-    fn commit_transaction<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<RepoTransactionStats, Error>;
-
-    fn copy_config(&self) -> Option<glib::KeyFile>;
-
-    fn create<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, mode: RepoMode, cancellable: P) -> Result<(), Error>;
-
-    fn delete_object<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2017_12", feature = "dox"))]
-    fn equal(&self, b: &Repo) -> bool;
-
-    //fn export_tree_to_archive<'a, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: &RepoFile, archive: P, cancellable: Q) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2017_15", feature = "dox"))]
-    fn fsck_object<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2019_2", feature = "dox"))]
-    fn get_bootloader(&self) -> Option<String>;
-
-    #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn get_collection_id(&self) -> Option<String>;
-
-    fn get_config(&self) -> Option<glib::KeyFile>;
-
-    #[cfg(any(feature = "v2018_9", feature = "dox"))]
-    fn get_default_repo_finders(&self) -> Vec<String>;
-
-    #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn get_dfd(&self) -> i32;
-
-    fn get_disable_fsync(&self) -> bool;
-
-    #[cfg(any(feature = "v2018_9", feature = "dox"))]
-    fn get_min_free_space_bytes(&self) -> Result<u64, Error>;
-
-    fn get_mode(&self) -> RepoMode;
-
-    fn get_parent(&self) -> Option<Repo>;
-
-    fn get_path(&self) -> Option<gio::File>;
-
-    #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn get_remote_boolean_option(&self, remote_name: &str, option_name: &str, default_value: bool) -> Result<bool, Error>;
-
-    #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn get_remote_list_option(&self, remote_name: &str, option_name: &str) -> Result<Vec<String>, Error>;
-
-    #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn get_remote_option<'a, P: Into<Option<&'a str>>>(&self, remote_name: &str, option_name: &str, default_value: P) -> Result<String, Error>;
-
-    #[cfg(any(feature = "v2016_6", feature = "dox"))]
-    fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into<Option<&'a str>>, Q: IsA<gio::File> + 'b, R: Into<Option<&'b Q>>, S: IsA<gio::File> + 'c, T: Into<Option<&'c S>>, U: Into<Option<&'d gio::Cancellable>>>(&self, remote_name: P, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result<GpgVerifyResult, Error>;
-
-    fn has_object<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<bool, Error>;
-
-    #[cfg(any(feature = "v2017_12", feature = "dox"))]
-    fn hash(&self) -> u32;
-
-    //fn import_archive_to_mtree<'a, 'b, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error>;
-
-    fn import_object_from<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn import_object_from_with_trust<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, trusted: bool, cancellable: P) -> Result<(), Error>;
-
-    fn is_system(&self) -> bool;
-
-    fn is_writable(&self) -> Result<(), Error>;
-
-    //#[cfg(any(feature = "v2018_6", feature = "dox"))]
-    //fn list_collection_refs<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, match_collection_id: P, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Q) -> Result<(), Error>;
-
-    //fn list_commit_objects_starting_with<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, start: &str, out_commits: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: P) -> Result<(), Error>;
-
-    //fn list_objects<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, flags: /*Ignored*/RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: P) -> Result<(), Error>;
-
-    //fn list_refs<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, refspec_prefix: P, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: Q) -> Result<(), Error>;
-
-    //#[cfg(any(feature = "v2016_4", feature = "dox"))]
-    //fn list_refs_ext<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, refspec_prefix: P, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Q) -> Result<(), Error>;
-
-    //fn list_static_delta_names<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, out_deltas: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, cancellable: P) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2015_7", feature = "dox"))]
-    fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, RepoCommitState), Error>;
-
-    fn load_file<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, cancellable: P) -> Result<(Option<gio::InputStream>, Option<gio::FileInfo>, Option<glib::Variant>), Error>;
-
-    fn load_object_stream<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<(gio::InputStream, u64), Error>;
-
-    fn load_variant(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, Error>;
-
-    fn load_variant_if_exists(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, Error>;
-
-    #[cfg(any(feature = "v2017_15", feature = "dox"))]
-    fn mark_commit_partial(&self, checksum: &str, is_partial: bool) -> Result<(), Error>;
-
-    fn open<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
-
-    fn prepare_transaction<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<bool, Error>;
-
-    fn prune<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, flags: RepoPruneFlags, depth: i32, cancellable: P) -> Result<(i32, i32, u64), Error>;
-
-    //#[cfg(any(feature = "v2017_1", feature = "dox"))]
-    //fn prune_from_reachable<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: P) -> Result<(i32, i32, u64), Error>;
-
-    fn prune_static_deltas<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, commit: P, cancellable: Q) -> Result<(), Error>;
-
-    fn pull<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error>;
-
-    fn pull_one_dir<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error>;
-
-    fn pull_with_options<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: P, cancellable: Q) -> Result<(), Error>;
-
-    fn query_object_storage_size<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result<u64, Error>;
-
-    fn read_commit<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, ref_: &str, cancellable: P) -> Result<(gio::File, String), Error>;
-
-    fn read_commit_detached_metadata<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, cancellable: P) -> Result<glib::Variant, Error>;
-
-    fn regenerate_summary<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, additional_metadata: P, cancellable: Q) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2017_2", feature = "dox"))]
-    fn reload_config<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
-
-    fn remote_add<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, url: &str, options: P, cancellable: Q) -> Result<(), Error>;
-
-    fn remote_change<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: Into<Option<&'b glib::Variant>>, S: Into<Option<&'c gio::Cancellable>>>(&self, sysroot: Q, changeop: RepoRemoteChange, name: &str, url: &str, options: R, cancellable: S) -> Result<(), Error>;
-
-    fn remote_delete<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, name: &str, cancellable: P) -> Result<(), Error>;
-
-    fn remote_fetch_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, name: &str, cancellable: P) -> Result<(glib::Bytes, glib::Bytes), Error>;
-
-    #[cfg(any(feature = "v2016_6", feature = "dox"))]
-    fn remote_fetch_summary_with_options<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, options: P, cancellable: Q) -> Result<(glib::Bytes, glib::Bytes), Error>;
-
-    fn remote_get_gpg_verify(&self, name: &str) -> Result<bool, Error>;
-
-    fn remote_get_gpg_verify_summary(&self, name: &str) -> Result<bool, Error>;
-
-    fn remote_get_url(&self, name: &str) -> Result<String, Error>;
-
-    fn remote_gpg_import<'a, 'b, P: IsA<gio::InputStream> + 'a, Q: Into<Option<&'a P>>, R: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, source_stream: Q, key_ids: &[&str], cancellable: R) -> Result<u32, Error>;
-
-    fn remote_list(&self) -> Vec<String>;
-
-    //#[cfg(any(feature = "v2018_6", feature = "dox"))]
-    //fn remote_list_collection_refs<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 28 }, cancellable: P) -> Result<(), Error>;
-
-    //fn remote_list_refs<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: P) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn resolve_collection_ref<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, ref_: &CollectionRef, allow_noent: bool, flags: RepoResolveRevExtFlags, cancellable: P) -> Result<Option<String>, Error>;
-
-    #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn resolve_keyring_for_collection<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, collection_id: &str, cancellable: P) -> Result<Remote, Error>;
-
-    fn resolve_rev(&self, refspec: &str, allow_noent: bool) -> Result<String, Error>;
-
-    #[cfg(any(feature = "v2016_7", feature = "dox"))]
-    fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result<String, Error>;
-
-    fn scan_hardlinks<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2017_10", feature = "dox"))]
-    fn set_alias_ref_immediate<'a, 'b, 'c, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c gio::Cancellable>>>(&self, remote: P, ref_: &str, target: Q, cancellable: R) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn set_cache_dir<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, dfd: i32, path: &str, cancellable: P) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn set_collection_id<'a, P: Into<Option<&'a str>>>(&self, collection_id: P) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn set_collection_ref_immediate<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, ref_: &CollectionRef, checksum: P, cancellable: Q) -> Result<(), Error>;
-
-    fn set_disable_fsync(&self, disable_fsync: bool);
-
-    fn set_ref_immediate<'a, 'b, 'c, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c gio::Cancellable>>>(&self, remote: P, ref_: &str, checksum: Q, cancellable: R) -> Result<(), Error>;
-
-    fn sign_commit<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, commit_checksum: &str, key_id: &str, homedir: P, cancellable: Q) -> Result<(), Error>;
-
-    fn sign_delta<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, from_commit: &str, to_commit: &str, key_id: &str, homedir: &str, cancellable: P) -> Result<(), Error>;
-
-    fn static_delta_execute_offline<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, dir_or_file: &P, skip_validation: bool, cancellable: Q) -> Result<(), Error>;
-
-    fn static_delta_generate<'a, 'b, 'c, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b glib::Variant>>, R: Into<Option<&'c gio::Cancellable>>>(&self, opt: StaticDeltaGenerateOpt, from: &str, to: &str, metadata: P, params: Q, cancellable: R) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn transaction_set_collection_ref<'a, P: Into<Option<&'a str>>>(&self, ref_: &CollectionRef, checksum: P);
-
-    fn transaction_set_ref<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(&self, remote: P, ref_: &str, checksum: Q);
-
-    fn transaction_set_refspec<'a, P: Into<Option<&'a str>>>(&self, refspec: &str, checksum: P);
-
-    //fn traverse_commit<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, maxdepth: i32, out_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: P) -> Result<(), Error>;
-
-    //fn traverse_commit_union<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, maxdepth: i32, inout_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, cancellable: P) -> Result<(), Error>;
-
-    //#[cfg(any(feature = "v2018_5", feature = "dox"))]
-    //fn traverse_commit_union_with_parents<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, maxdepth: i32, inout_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, inout_parents: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, cancellable: P) -> Result<(), Error>;
-
-    //#[cfg(any(feature = "v2018_6", feature = "dox"))]
-    //fn traverse_reachable_refs<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, depth: u32, reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: P) -> Result<(), Error>;
-
-    fn verify_commit<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: IsA<gio::File> + 'b, S: Into<Option<&'b R>>, T: Into<Option<&'c gio::Cancellable>>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result<(), Error>;
-
-    fn verify_commit_ext<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: IsA<gio::File> + 'b, S: Into<Option<&'b R>>, T: Into<Option<&'c gio::Cancellable>>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result<GpgVerifyResult, Error>;
-
-    #[cfg(any(feature = "v2016_14", feature = "dox"))]
-    fn verify_commit_for_remote<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result<GpgVerifyResult, Error>;
-
-    fn verify_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, remote_name: &str, summary: &glib::Bytes, signatures: &glib::Bytes, cancellable: P) -> Result<GpgVerifyResult, Error>;
-
-    fn write_archive_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, archive: &P, mtree: &MutableTree, modifier: Q, autocreate_parents: bool, cancellable: R) -> Result<(), Error>;
-
-    fn write_commit<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, cancellable: T) -> Result<String, Error>;
-
-    fn write_commit_detached_metadata<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, checksum: &str, metadata: P, cancellable: Q) -> Result<(), Error>;
-
-    fn write_commit_with_time<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, time: u64, cancellable: T) -> Result<String, Error>;
-
-    fn write_config(&self, new_config: &glib::KeyFile) -> Result<(), Error>;
-
-    //fn write_content<'a, 'b, P: Into<Option<&'a str>>, Q: IsA<gio::InputStream>, R: Into<Option<&'b gio::Cancellable>>>(&self, expected_checksum: P, object_input: &Q, length: u64, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: R) -> Result<(), Error>;
-
-    fn write_content_trusted<'a, P: IsA<gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error>;
-
-    fn write_dfd_to_mtree<'a, 'b, P: Into<Option<&'a RepoCommitModifier>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, dfd: i32, path: &str, mtree: &MutableTree, modifier: P, cancellable: Q) -> Result<(), Error>;
-
-    fn write_directory_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, dir: &P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error>;
-
-    //fn write_metadata<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, objtype: ObjectType, expected_checksum: P, object: &glib::Variant, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Q) -> Result<(), Error>;
-
-    fn write_metadata_stream_trusted<'a, P: IsA<gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error>;
-
-    fn write_metadata_trusted<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, variant: &glib::Variant, cancellable: P) -> Result<(), Error>;
-
-    fn write_mtree<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, mtree: &MutableTree, cancellable: P) -> Result<gio::File, Error>;
-
-    fn get_property_remotes_config_dir(&self) -> Option<String>;
-
-    fn get_property_sysroot_path(&self) -> Option<gio::File>;
-
-    fn connect_gpg_verify_result<F: Fn(&Self, &str, &GpgVerifyResult) + 'static>(&self, f: F) -> SignalHandlerId;
-}
-
-impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
-    fn abort_transaction<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn abort_transaction<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_abort_transaction(self.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_abort_transaction(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn add_gpg_signature_summary<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, key_id: &[&str], homedir: P, cancellable: Q) -> Result<(), Error> {
-        let homedir = homedir.into();
-        let homedir = homedir.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn add_gpg_signature_summary<P: IsA<gio::Cancellable>>(&self, key_id: &[&str], homedir: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_add_gpg_signature_summary(self.to_glib_none().0, key_id.to_glib_none().0, homedir.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_add_gpg_signature_summary(self.to_glib_none().0, key_id.to_glib_none().0, homedir.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn append_gpg_signature<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, signature_bytes: &glib::Bytes, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn append_gpg_signature<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, signature_bytes: &glib::Bytes, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_append_gpg_signature(self.to_glib_none().0, commit_checksum.to_glib_none().0, signature_bytes.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_append_gpg_signature(self.to_glib_none().0, commit_checksum.to_glib_none().0, signature_bytes.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     //#[cfg(any(feature = "v2016_8", feature = "dox"))]
-    //fn checkout_at<'a, 'b, P: Into<Option<&'a /*Ignored*/RepoCheckoutAtOptions>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_checkout_at() }
+    //pub fn checkout_at<P: IsA<gio::Cancellable>>(&self, options: /*Ignored*/Option<&mut RepoCheckoutAtOptions>, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_checkout_at() }
     //}
 
-    fn checkout_gc<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn checkout_gc<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_checkout_gc(self.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_checkout_gc(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn checkout_tree<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, mode: RepoCheckoutMode, overwrite_mode: RepoCheckoutOverwriteMode, destination: &P, source: &RepoFile, source_info: &gio::FileInfo, cancellable: Q) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn checkout_tree<P: IsA<gio::File>, Q: IsA<RepoFile>, R: IsA<gio::Cancellable>>(&self, mode: RepoCheckoutMode, overwrite_mode: RepoCheckoutOverwriteMode, destination: &P, source: &Q, source_info: &gio::FileInfo, cancellable: Option<&R>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_checkout_tree(self.to_glib_none().0, mode.to_glib(), overwrite_mode.to_glib(), destination.to_glib_none().0, source.to_glib_none().0, source_info.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_checkout_tree(self.to_glib_none().0, mode.to_glib(), overwrite_mode.to_glib(), destination.as_ref().to_glib_none().0, source.as_ref().to_glib_none().0, source_info.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    //fn checkout_tree_at<'a, 'b, P: Into<Option<&'a /*Ignored*/RepoCheckoutOptions>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_checkout_tree_at() }
+    //pub fn checkout_tree_at<P: IsA<gio::Cancellable>>(&self, options: /*Ignored*/Option<&mut RepoCheckoutOptions>, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_checkout_tree_at() }
     //}
 
-    fn commit_transaction<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<RepoTransactionStats, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn commit_transaction<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<RepoTransactionStats, Error> {
         unsafe {
             let mut out_stats = RepoTransactionStats::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_commit_transaction(self.to_glib_none().0, out_stats.to_glib_none_mut().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_commit_transaction(self.to_glib_none().0, out_stats.to_glib_none_mut().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(out_stats) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn copy_config(&self) -> Option<glib::KeyFile> {
+    pub fn copy_config(&self) -> Option<glib::KeyFile> {
         unsafe {
-            from_glib_full(ffi::ostree_repo_copy_config(self.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_repo_copy_config(self.to_glib_none().0))
         }
     }
 
-    fn create<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, mode: RepoMode, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn create<P: IsA<gio::Cancellable>>(&self, mode: RepoMode, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_create(self.to_glib_none().0, mode.to_glib(), cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_create(self.to_glib_none().0, mode.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn delete_object<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn delete_object<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_delete_object(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_delete_object(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2017_12", feature = "dox"))]
-    fn equal(&self, b: &Repo) -> bool {
+    pub fn equal(&self, b: &Repo) -> bool {
         unsafe {
-            from_glib(ffi::ostree_repo_equal(self.to_glib_none().0, b.to_glib_none().0))
+            from_glib(ostree_sys::ostree_repo_equal(self.to_glib_none().0, b.to_glib_none().0))
         }
     }
 
-    //fn export_tree_to_archive<'a, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: &RepoFile, archive: P, cancellable: Q) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_export_tree_to_archive() }
+    //pub fn export_tree_to_archive<P: IsA<RepoFile>, Q: IsA<gio::Cancellable>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: &P, archive: /*Unimplemented*/Option<Fundamental: Pointer>, cancellable: Option<&Q>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_export_tree_to_archive() }
     //}
 
     #[cfg(any(feature = "v2017_15", feature = "dox"))]
-    fn fsck_object<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn fsck_object<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_fsck_object(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_fsck_object(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2019_2", feature = "dox"))]
-    fn get_bootloader(&self) -> Option<String> {
+    pub fn get_bootloader(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_repo_get_bootloader(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_repo_get_bootloader(self.to_glib_none().0))
         }
     }
 
     #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn get_collection_id(&self) -> Option<String> {
+    pub fn get_collection_id(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_repo_get_collection_id(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_repo_get_collection_id(self.to_glib_none().0))
         }
     }
 
-    fn get_config(&self) -> Option<glib::KeyFile> {
+    pub fn get_config(&self) -> Option<glib::KeyFile> {
         unsafe {
-            from_glib_none(ffi::ostree_repo_get_config(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_repo_get_config(self.to_glib_none().0))
         }
     }
 
     #[cfg(any(feature = "v2018_9", feature = "dox"))]
-    fn get_default_repo_finders(&self) -> Vec<String> {
+    pub fn get_default_repo_finders(&self) -> Vec<GString> {
         unsafe {
-            FromGlibPtrContainer::from_glib_none(ffi::ostree_repo_get_default_repo_finders(self.to_glib_none().0))
+            FromGlibPtrContainer::from_glib_none(ostree_sys::ostree_repo_get_default_repo_finders(self.to_glib_none().0))
         }
     }
 
     #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn get_dfd(&self) -> i32 {
+    pub fn get_dfd(&self) -> i32 {
         unsafe {
-            ffi::ostree_repo_get_dfd(self.to_glib_none().0)
+            ostree_sys::ostree_repo_get_dfd(self.to_glib_none().0)
         }
     }
 
-    fn get_disable_fsync(&self) -> bool {
+    pub fn get_disable_fsync(&self) -> bool {
         unsafe {
-            from_glib(ffi::ostree_repo_get_disable_fsync(self.to_glib_none().0))
+            from_glib(ostree_sys::ostree_repo_get_disable_fsync(self.to_glib_none().0))
         }
     }
 
     #[cfg(any(feature = "v2018_9", feature = "dox"))]
-    fn get_min_free_space_bytes(&self) -> Result<u64, Error> {
+    pub fn get_min_free_space_bytes(&self) -> Result<u64, Error> {
         unsafe {
             let mut out_reserved_bytes = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_get_min_free_space_bytes(self.to_glib_none().0, &mut out_reserved_bytes, &mut error);
+            let _ = ostree_sys::ostree_repo_get_min_free_space_bytes(self.to_glib_none().0, &mut out_reserved_bytes, &mut error);
             if error.is_null() { Ok(out_reserved_bytes) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn get_mode(&self) -> RepoMode {
+    pub fn get_mode(&self) -> RepoMode {
         unsafe {
-            from_glib(ffi::ostree_repo_get_mode(self.to_glib_none().0))
+            from_glib(ostree_sys::ostree_repo_get_mode(self.to_glib_none().0))
         }
     }
 
-    fn get_parent(&self) -> Option<Repo> {
+    pub fn get_parent(&self) -> Option<Repo> {
         unsafe {
-            from_glib_none(ffi::ostree_repo_get_parent(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_repo_get_parent(self.to_glib_none().0))
         }
     }
 
-    fn get_path(&self) -> Option<gio::File> {
+    pub fn get_path(&self) -> Option<gio::File> {
         unsafe {
-            from_glib_none(ffi::ostree_repo_get_path(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_repo_get_path(self.to_glib_none().0))
         }
     }
 
     #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn get_remote_boolean_option(&self, remote_name: &str, option_name: &str, default_value: bool) -> Result<bool, Error> {
+    pub fn get_remote_boolean_option(&self, remote_name: &str, option_name: &str, default_value: bool) -> Result<bool, Error> {
         unsafe {
             let mut out_value = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_get_remote_boolean_option(self.to_glib_none().0, remote_name.to_glib_none().0, option_name.to_glib_none().0, default_value.to_glib(), &mut out_value, &mut error);
+            let _ = ostree_sys::ostree_repo_get_remote_boolean_option(self.to_glib_none().0, remote_name.to_glib_none().0, option_name.to_glib_none().0, default_value.to_glib(), &mut out_value, &mut error);
             if error.is_null() { Ok(from_glib(out_value)) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn get_remote_list_option(&self, remote_name: &str, option_name: &str) -> Result<Vec<String>, Error> {
+    pub fn get_remote_list_option(&self, remote_name: &str, option_name: &str) -> Result<Vec<GString>, Error> {
         unsafe {
             let mut out_value = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_get_remote_list_option(self.to_glib_none().0, remote_name.to_glib_none().0, option_name.to_glib_none().0, &mut out_value, &mut error);
+            let _ = ostree_sys::ostree_repo_get_remote_list_option(self.to_glib_none().0, remote_name.to_glib_none().0, option_name.to_glib_none().0, &mut out_value, &mut error);
             if error.is_null() { Ok(FromGlibPtrContainer::from_glib_full(out_value)) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn get_remote_option<'a, P: Into<Option<&'a str>>>(&self, remote_name: &str, option_name: &str, default_value: P) -> Result<String, Error> {
-        let default_value = default_value.into();
-        let default_value = default_value.to_glib_none();
+    pub fn get_remote_option(&self, remote_name: &str, option_name: &str, default_value: Option<&str>) -> Result<GString, Error> {
         unsafe {
             let mut out_value = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_get_remote_option(self.to_glib_none().0, remote_name.to_glib_none().0, option_name.to_glib_none().0, default_value.0, &mut out_value, &mut error);
+            let _ = ostree_sys::ostree_repo_get_remote_option(self.to_glib_none().0, remote_name.to_glib_none().0, option_name.to_glib_none().0, default_value.to_glib_none().0, &mut out_value, &mut error);
             if error.is_null() { Ok(from_glib_full(out_value)) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2016_6", feature = "dox"))]
-    fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into<Option<&'a str>>, Q: IsA<gio::File> + 'b, R: Into<Option<&'b Q>>, S: IsA<gio::File> + 'c, T: Into<Option<&'c S>>, U: Into<Option<&'d gio::Cancellable>>>(&self, remote_name: P, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result<GpgVerifyResult, Error> {
-        let remote_name = remote_name.into();
-        let remote_name = remote_name.to_glib_none();
-        let keyringdir = keyringdir.into();
-        let keyringdir = keyringdir.to_glib_none();
-        let extra_keyring = extra_keyring.into();
-        let extra_keyring = extra_keyring.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
-        unsafe {
-            let mut error = ptr::null_mut();
-            let ret = ffi::ostree_repo_gpg_verify_data(self.to_glib_none().0, remote_name.0, data.to_glib_none().0, signatures.to_glib_none().0, keyringdir.0, extra_keyring.0, cancellable.0, &mut error);
+    pub fn gpg_verify_data<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(&self, remote_name: Option<&str>, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: Option<&P>, extra_keyring: Option<&Q>, cancellable: Option<&R>) -> Result<GpgVerifyResult, Error> {
+        unsafe {
+            let mut error = ptr::null_mut();
+            let ret = ostree_sys::ostree_repo_gpg_verify_data(self.to_glib_none().0, remote_name.to_glib_none().0, data.to_glib_none().0, signatures.to_glib_none().0, keyringdir.map(|p| p.as_ref()).to_glib_none().0, extra_keyring.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn has_object<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<bool, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn has_object<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, cancellable: Option<&P>) -> Result<bool, Error> {
         unsafe {
             let mut out_have_object = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_has_object(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, &mut out_have_object, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_has_object(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, &mut out_have_object, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib(out_have_object)) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2017_12", feature = "dox"))]
-    fn hash(&self) -> u32 {
+    pub fn hash(&self) -> u32 {
         unsafe {
-            ffi::ostree_repo_hash(self.to_glib_none().0)
+            ostree_sys::ostree_repo_hash(self.to_glib_none().0)
         }
     }
 
-    //fn import_archive_to_mtree<'a, 'b, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_import_archive_to_mtree() }
+    //pub fn import_archive_to_mtree<P: IsA<MutableTree>, Q: IsA<gio::Cancellable>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: /*Unimplemented*/Option<Fundamental: Pointer>, mtree: &P, modifier: Option<&RepoCommitModifier>, cancellable: Option<&Q>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_import_archive_to_mtree() }
     //}
 
-    fn import_object_from<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn import_object_from<P: IsA<gio::Cancellable>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_import_object_from(self.to_glib_none().0, source.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_import_object_from(self.to_glib_none().0, source.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn import_object_from_with_trust<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, trusted: bool, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn import_object_from_with_trust<P: IsA<gio::Cancellable>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, trusted: bool, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_import_object_from_with_trust(self.to_glib_none().0, source.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, trusted.to_glib(), cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_import_object_from_with_trust(self.to_glib_none().0, source.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, trusted.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn is_system(&self) -> bool {
+    pub fn is_system(&self) -> bool {
         unsafe {
-            from_glib(ffi::ostree_repo_is_system(self.to_glib_none().0))
+            from_glib(ostree_sys::ostree_repo_is_system(self.to_glib_none().0))
         }
     }
 
-    fn is_writable(&self) -> Result<(), Error> {
+    pub fn is_writable(&self) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_is_writable(self.to_glib_none().0, &mut error);
+            let _ = ostree_sys::ostree_repo_is_writable(self.to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     //#[cfg(any(feature = "v2018_6", feature = "dox"))]
-    //fn list_collection_refs<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, match_collection_id: P, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Q) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_list_collection_refs() }
+    //pub fn list_collection_refs<P: IsA<gio::Cancellable>>(&self, match_collection_id: Option<&str>, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_list_collection_refs() }
     //}
 
-    //fn list_commit_objects_starting_with<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, start: &str, out_commits: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: P) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_list_commit_objects_starting_with() }
+    //pub fn list_commit_objects_starting_with<P: IsA<gio::Cancellable>>(&self, start: &str, out_commits: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_list_commit_objects_starting_with() }
     //}
 
-    //fn list_objects<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, flags: /*Ignored*/RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: P) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_list_objects() }
+    //pub fn list_objects<P: IsA<gio::Cancellable>>(&self, flags: /*Ignored*/RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_list_objects() }
     //}
 
-    //fn list_refs<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, refspec_prefix: P, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: Q) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_list_refs() }
+    //pub fn list_refs<P: IsA<gio::Cancellable>>(&self, refspec_prefix: Option<&str>, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_list_refs() }
     //}
 
     //#[cfg(any(feature = "v2016_4", feature = "dox"))]
-    //fn list_refs_ext<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, refspec_prefix: P, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Q) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_list_refs_ext() }
+    //pub fn list_refs_ext<P: IsA<gio::Cancellable>>(&self, refspec_prefix: Option<&str>, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_list_refs_ext() }
     //}
 
-    //fn list_static_delta_names<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, out_deltas: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, cancellable: P) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_list_static_delta_names() }
+    //pub fn list_static_delta_names<P: IsA<gio::Cancellable>>(&self, out_deltas: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_list_static_delta_names() }
     //}
 
     #[cfg(any(feature = "v2015_7", feature = "dox"))]
-    fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, RepoCommitState), Error> {
+    pub fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, RepoCommitState), Error> {
         unsafe {
             let mut out_commit = ptr::null_mut();
             let mut out_state = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_load_commit(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_commit, &mut out_state, &mut error);
+            let _ = ostree_sys::ostree_repo_load_commit(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_commit, &mut out_state, &mut error);
             if error.is_null() { Ok((from_glib_full(out_commit), from_glib(out_state))) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn load_file<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, cancellable: P) -> Result<(Option<gio::InputStream>, Option<gio::FileInfo>, Option<glib::Variant>), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn load_file<P: IsA<gio::Cancellable>>(&self, checksum: &str, cancellable: Option<&P>) -> Result<(Option<gio::InputStream>, Option<gio::FileInfo>, Option<glib::Variant>), Error> {
         unsafe {
             let mut out_input = ptr::null_mut();
             let mut out_file_info = ptr::null_mut();
             let mut out_xattrs = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_load_file(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_load_file(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok((from_glib_full(out_input), from_glib_full(out_file_info), from_glib_full(out_xattrs))) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn load_object_stream<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<(gio::InputStream, u64), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn load_object_stream<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, cancellable: Option<&P>) -> Result<(gio::InputStream, u64), Error> {
         unsafe {
             let mut out_input = ptr::null_mut();
             let mut out_size = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_load_object_stream(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, &mut out_input, &mut out_size, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_load_object_stream(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, &mut out_input, &mut out_size, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok((from_glib_full(out_input), out_size)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn load_variant(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, Error> {
+    pub fn load_variant(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, Error> {
         unsafe {
             let mut out_variant = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_load_variant(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, &mut out_variant, &mut error);
+            let _ = ostree_sys::ostree_repo_load_variant(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, &mut out_variant, &mut error);
             if error.is_null() { Ok(from_glib_full(out_variant)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn load_variant_if_exists(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, Error> {
+    pub fn load_variant_if_exists(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, Error> {
         unsafe {
             let mut out_variant = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_load_variant_if_exists(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, &mut out_variant, &mut error);
+            let _ = ostree_sys::ostree_repo_load_variant_if_exists(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, &mut out_variant, &mut error);
             if error.is_null() { Ok(from_glib_full(out_variant)) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2017_15", feature = "dox"))]
-    fn mark_commit_partial(&self, checksum: &str, is_partial: bool) -> Result<(), Error> {
+    pub fn mark_commit_partial(&self, checksum: &str, is_partial: bool) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_mark_commit_partial(self.to_glib_none().0, checksum.to_glib_none().0, is_partial.to_glib(), &mut error);
+            let _ = ostree_sys::ostree_repo_mark_commit_partial(self.to_glib_none().0, checksum.to_glib_none().0, is_partial.to_glib(), &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn open<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn open<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_open(self.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_open(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn prepare_transaction<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<bool, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn prepare_transaction<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<bool, Error> {
         unsafe {
             let mut out_transaction_resume = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_prepare_transaction(self.to_glib_none().0, &mut out_transaction_resume, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_prepare_transaction(self.to_glib_none().0, &mut out_transaction_resume, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib(out_transaction_resume)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn prune<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, flags: RepoPruneFlags, depth: i32, cancellable: P) -> Result<(i32, i32, u64), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn prune<P: IsA<gio::Cancellable>>(&self, flags: RepoPruneFlags, depth: i32, cancellable: Option<&P>) -> Result<(i32, i32, u64), Error> {
         unsafe {
             let mut out_objects_total = mem::uninitialized();
             let mut out_objects_pruned = mem::uninitialized();
             let mut out_pruned_object_size_total = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_prune(self.to_glib_none().0, flags.to_glib(), depth, &mut out_objects_total, &mut out_objects_pruned, &mut out_pruned_object_size_total, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_prune(self.to_glib_none().0, flags.to_glib(), depth, &mut out_objects_total, &mut out_objects_pruned, &mut out_pruned_object_size_total, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok((out_objects_total, out_objects_pruned, out_pruned_object_size_total)) } else { Err(from_glib_full(error)) }
         }
     }
 
     //#[cfg(any(feature = "v2017_1", feature = "dox"))]
-    //fn prune_from_reachable<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: P) -> Result<(i32, i32, u64), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_prune_from_reachable() }
+    //pub fn prune_from_reachable<P: IsA<gio::Cancellable>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: Option<&P>) -> Result<(i32, i32, u64), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_prune_from_reachable() }
     //}
 
-    fn prune_static_deltas<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, commit: P, cancellable: Q) -> Result<(), Error> {
-        let commit = commit.into();
-        let commit = commit.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn prune_static_deltas<P: IsA<gio::Cancellable>>(&self, commit: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_prune_static_deltas(self.to_glib_none().0, commit.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_prune_static_deltas(self.to_glib_none().0, commit.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn pull<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error> {
-        let progress = progress.into();
-        let progress = progress.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn pull<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_pull(self.to_glib_none().0, remote_name.to_glib_none().0, refs_to_fetch.to_glib_none().0, flags.to_glib(), progress.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_pull(self.to_glib_none().0, remote_name.to_glib_none().0, refs_to_fetch.to_glib_none().0, flags.to_glib(), progress.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn pull_one_dir<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error> {
-        let progress = progress.into();
-        let progress = progress.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn pull_one_dir<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_pull_one_dir(self.to_glib_none().0, remote_name.to_glib_none().0, dir_to_pull.to_glib_none().0, refs_to_fetch.to_glib_none().0, flags.to_glib(), progress.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_pull_one_dir(self.to_glib_none().0, remote_name.to_glib_none().0, dir_to_pull.to_glib_none().0, refs_to_fetch.to_glib_none().0, flags.to_glib(), progress.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn pull_with_options<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: P, cancellable: Q) -> Result<(), Error> {
-        let progress = progress.into();
-        let progress = progress.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn pull_with_options<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: Option<&P>, cancellable: Option<&Q>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_pull_with_options(self.to_glib_none().0, remote_name_or_baseurl.to_glib_none().0, options.to_glib_none().0, progress.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_pull_with_options(self.to_glib_none().0, remote_name_or_baseurl.to_glib_none().0, options.to_glib_none().0, progress.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn query_object_storage_size<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result<u64, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn query_object_storage_size<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&P>) -> Result<u64, Error> {
         unsafe {
             let mut out_size = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_query_object_storage_size(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, &mut out_size, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_query_object_storage_size(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, &mut out_size, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(out_size) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn read_commit<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, ref_: &str, cancellable: P) -> Result<(gio::File, String), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn read_commit<P: IsA<gio::Cancellable>>(&self, ref_: &str, cancellable: Option<&P>) -> Result<(gio::File, GString), Error> {
         unsafe {
             let mut out_root = ptr::null_mut();
             let mut out_commit = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_read_commit(self.to_glib_none().0, ref_.to_glib_none().0, &mut out_root, &mut out_commit, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_read_commit(self.to_glib_none().0, ref_.to_glib_none().0, &mut out_root, &mut out_commit, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok((from_glib_full(out_root), from_glib_full(out_commit))) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn read_commit_detached_metadata<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, cancellable: P) -> Result<glib::Variant, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn read_commit_detached_metadata<P: IsA<gio::Cancellable>>(&self, checksum: &str, cancellable: Option<&P>) -> Result<glib::Variant, Error> {
         unsafe {
             let mut out_metadata = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_read_commit_detached_metadata(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_metadata, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_read_commit_detached_metadata(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_metadata, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_metadata)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn regenerate_summary<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, additional_metadata: P, cancellable: Q) -> Result<(), Error> {
-        let additional_metadata = additional_metadata.into();
-        let additional_metadata = additional_metadata.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn regenerate_summary<P: IsA<gio::Cancellable>>(&self, additional_metadata: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_regenerate_summary(self.to_glib_none().0, additional_metadata.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_regenerate_summary(self.to_glib_none().0, additional_metadata.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2017_2", feature = "dox"))]
-    fn reload_config<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn reload_config<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_reload_config(self.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_reload_config(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn remote_add<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, url: &str, options: P, cancellable: Q) -> Result<(), Error> {
-        let options = options.into();
-        let options = options.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn remote_add<P: IsA<gio::Cancellable>>(&self, name: &str, url: &str, options: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_remote_add(self.to_glib_none().0, name.to_glib_none().0, url.to_glib_none().0, options.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_remote_add(self.to_glib_none().0, name.to_glib_none().0, url.to_glib_none().0, options.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn remote_change<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: Into<Option<&'b glib::Variant>>, S: Into<Option<&'c gio::Cancellable>>>(&self, sysroot: Q, changeop: RepoRemoteChange, name: &str, url: &str, options: R, cancellable: S) -> Result<(), Error> {
-        let sysroot = sysroot.into();
-        let sysroot = sysroot.to_glib_none();
-        let options = options.into();
-        let options = options.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn remote_change<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, sysroot: Option<&P>, changeop: RepoRemoteChange, name: &str, url: &str, options: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_remote_change(self.to_glib_none().0, sysroot.0, changeop.to_glib(), name.to_glib_none().0, url.to_glib_none().0, options.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_remote_change(self.to_glib_none().0, sysroot.map(|p| p.as_ref()).to_glib_none().0, changeop.to_glib(), name.to_glib_none().0, url.to_glib_none().0, options.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn remote_delete<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, name: &str, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn remote_delete<P: IsA<gio::Cancellable>>(&self, name: &str, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_remote_delete(self.to_glib_none().0, name.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_remote_delete(self.to_glib_none().0, name.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn remote_fetch_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, name: &str, cancellable: P) -> Result<(glib::Bytes, glib::Bytes), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn remote_fetch_summary<P: IsA<gio::Cancellable>>(&self, name: &str, cancellable: Option<&P>) -> Result<(glib::Bytes, glib::Bytes), Error> {
         unsafe {
             let mut out_summary = ptr::null_mut();
             let mut out_signatures = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_remote_fetch_summary(self.to_glib_none().0, name.to_glib_none().0, &mut out_summary, &mut out_signatures, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_remote_fetch_summary(self.to_glib_none().0, name.to_glib_none().0, &mut out_summary, &mut out_signatures, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok((from_glib_full(out_summary), from_glib_full(out_signatures))) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2016_6", feature = "dox"))]
-    fn remote_fetch_summary_with_options<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, options: P, cancellable: Q) -> Result<(glib::Bytes, glib::Bytes), Error> {
-        let options = options.into();
-        let options = options.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn remote_fetch_summary_with_options<P: IsA<gio::Cancellable>>(&self, name: &str, options: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(glib::Bytes, glib::Bytes), Error> {
         unsafe {
             let mut out_summary = ptr::null_mut();
             let mut out_signatures = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_remote_fetch_summary_with_options(self.to_glib_none().0, name.to_glib_none().0, options.0, &mut out_summary, &mut out_signatures, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_remote_fetch_summary_with_options(self.to_glib_none().0, name.to_glib_none().0, options.to_glib_none().0, &mut out_summary, &mut out_signatures, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok((from_glib_full(out_summary), from_glib_full(out_signatures))) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn remote_get_gpg_verify(&self, name: &str) -> Result<bool, Error> {
+    pub fn remote_get_gpg_verify(&self, name: &str) -> Result<bool, Error> {
         unsafe {
             let mut out_gpg_verify = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_remote_get_gpg_verify(self.to_glib_none().0, name.to_glib_none().0, &mut out_gpg_verify, &mut error);
+            let _ = ostree_sys::ostree_repo_remote_get_gpg_verify(self.to_glib_none().0, name.to_glib_none().0, &mut out_gpg_verify, &mut error);
             if error.is_null() { Ok(from_glib(out_gpg_verify)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn remote_get_gpg_verify_summary(&self, name: &str) -> Result<bool, Error> {
+    pub fn remote_get_gpg_verify_summary(&self, name: &str) -> Result<bool, Error> {
         unsafe {
             let mut out_gpg_verify_summary = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_remote_get_gpg_verify_summary(self.to_glib_none().0, name.to_glib_none().0, &mut out_gpg_verify_summary, &mut error);
+            let _ = ostree_sys::ostree_repo_remote_get_gpg_verify_summary(self.to_glib_none().0, name.to_glib_none().0, &mut out_gpg_verify_summary, &mut error);
             if error.is_null() { Ok(from_glib(out_gpg_verify_summary)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn remote_get_url(&self, name: &str) -> Result<String, Error> {
+    pub fn remote_get_url(&self, name: &str) -> Result<GString, Error> {
         unsafe {
             let mut out_url = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_remote_get_url(self.to_glib_none().0, name.to_glib_none().0, &mut out_url, &mut error);
+            let _ = ostree_sys::ostree_repo_remote_get_url(self.to_glib_none().0, name.to_glib_none().0, &mut out_url, &mut error);
             if error.is_null() { Ok(from_glib_full(out_url)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn remote_gpg_import<'a, 'b, P: IsA<gio::InputStream> + 'a, Q: Into<Option<&'a P>>, R: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, source_stream: Q, key_ids: &[&str], cancellable: R) -> Result<u32, Error> {
-        let source_stream = source_stream.into();
-        let source_stream = source_stream.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn remote_gpg_import<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, name: &str, source_stream: Option<&P>, key_ids: &[&str], cancellable: Option<&Q>) -> Result<u32, Error> {
         unsafe {
             let mut out_imported = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_remote_gpg_import(self.to_glib_none().0, name.to_glib_none().0, source_stream.0, key_ids.to_glib_none().0, &mut out_imported, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_remote_gpg_import(self.to_glib_none().0, name.to_glib_none().0, source_stream.map(|p| p.as_ref()).to_glib_none().0, key_ids.to_glib_none().0, &mut out_imported, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(out_imported) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn remote_list(&self) -> Vec<String> {
+    pub fn remote_list(&self) -> Vec<GString> {
         unsafe {
             let mut out_n_remotes = mem::uninitialized();
-            let ret = FromGlibContainer::from_glib_full_num(ffi::ostree_repo_remote_list(self.to_glib_none().0, &mut out_n_remotes), out_n_remotes as usize);
+            let ret = FromGlibContainer::from_glib_full_num(ostree_sys::ostree_repo_remote_list(self.to_glib_none().0, &mut out_n_remotes), out_n_remotes as usize);
             ret
         }
     }
 
     //#[cfg(any(feature = "v2018_6", feature = "dox"))]
-    //fn remote_list_collection_refs<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 28 }, cancellable: P) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_remote_list_collection_refs() }
+    //pub fn remote_list_collection_refs<P: IsA<gio::Cancellable>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_remote_list_collection_refs() }
     //}
 
-    //fn remote_list_refs<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: P) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_remote_list_refs() }
+    //pub fn remote_list_refs<P: IsA<gio::Cancellable>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_remote_list_refs() }
     //}
 
     #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn resolve_collection_ref<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, ref_: &CollectionRef, allow_noent: bool, flags: RepoResolveRevExtFlags, cancellable: P) -> Result<Option<String>, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn resolve_collection_ref<P: IsA<gio::Cancellable>>(&self, ref_: &CollectionRef, allow_noent: bool, flags: RepoResolveRevExtFlags, cancellable: Option<&P>) -> Result<Option<GString>, Error> {
         unsafe {
             let mut out_rev = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_resolve_collection_ref(self.to_glib_none().0, ref_.to_glib_none().0, allow_noent.to_glib(), flags.to_glib(), &mut out_rev, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_resolve_collection_ref(self.to_glib_none().0, ref_.to_glib_none().0, allow_noent.to_glib(), flags.to_glib(), &mut out_rev, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_rev)) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn resolve_keyring_for_collection<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, collection_id: &str, cancellable: P) -> Result<Remote, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn resolve_keyring_for_collection<P: IsA<gio::Cancellable>>(&self, collection_id: &str, cancellable: Option<&P>) -> Result<Remote, Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let ret = ffi::ostree_repo_resolve_keyring_for_collection(self.to_glib_none().0, collection_id.to_glib_none().0, cancellable.0, &mut error);
+            let ret = ostree_sys::ostree_repo_resolve_keyring_for_collection(self.to_glib_none().0, collection_id.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn resolve_rev(&self, refspec: &str, allow_noent: bool) -> Result<String, Error> {
+    pub fn resolve_rev(&self, refspec: &str, allow_noent: bool) -> Result<GString, Error> {
         unsafe {
             let mut out_rev = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_resolve_rev(self.to_glib_none().0, refspec.to_glib_none().0, allow_noent.to_glib(), &mut out_rev, &mut error);
+            let _ = ostree_sys::ostree_repo_resolve_rev(self.to_glib_none().0, refspec.to_glib_none().0, allow_noent.to_glib(), &mut out_rev, &mut error);
             if error.is_null() { Ok(from_glib_full(out_rev)) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2016_7", feature = "dox"))]
-    fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result<String, Error> {
+    pub fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result<GString, Error> {
         unsafe {
             let mut out_rev = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_resolve_rev_ext(self.to_glib_none().0, refspec.to_glib_none().0, allow_noent.to_glib(), flags.to_glib(), &mut out_rev, &mut error);
+            let _ = ostree_sys::ostree_repo_resolve_rev_ext(self.to_glib_none().0, refspec.to_glib_none().0, allow_noent.to_glib(), flags.to_glib(), &mut out_rev, &mut error);
             if error.is_null() { Ok(from_glib_full(out_rev)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn scan_hardlinks<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn scan_hardlinks<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_scan_hardlinks(self.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_scan_hardlinks(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2017_10", feature = "dox"))]
-    fn set_alias_ref_immediate<'a, 'b, 'c, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c gio::Cancellable>>>(&self, remote: P, ref_: &str, target: Q, cancellable: R) -> Result<(), Error> {
-        let remote = remote.into();
-        let remote = remote.to_glib_none();
-        let target = target.into();
-        let target = target.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn set_alias_ref_immediate<P: IsA<gio::Cancellable>>(&self, remote: Option<&str>, ref_: &str, target: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_set_alias_ref_immediate(self.to_glib_none().0, remote.0, ref_.to_glib_none().0, target.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_set_alias_ref_immediate(self.to_glib_none().0, remote.to_glib_none().0, ref_.to_glib_none().0, target.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn set_cache_dir<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, dfd: i32, path: &str, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn set_cache_dir<P: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_set_cache_dir(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_set_cache_dir(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn set_collection_id<'a, P: Into<Option<&'a str>>>(&self, collection_id: P) -> Result<(), Error> {
-        let collection_id = collection_id.into();
-        let collection_id = collection_id.to_glib_none();
+    pub fn set_collection_id(&self, collection_id: Option<&str>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_set_collection_id(self.to_glib_none().0, collection_id.0, &mut error);
+            let _ = ostree_sys::ostree_repo_set_collection_id(self.to_glib_none().0, collection_id.to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn set_collection_ref_immediate<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, ref_: &CollectionRef, checksum: P, cancellable: Q) -> Result<(), Error> {
-        let checksum = checksum.into();
-        let checksum = checksum.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn set_collection_ref_immediate<P: IsA<gio::Cancellable>>(&self, ref_: &CollectionRef, checksum: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_set_collection_ref_immediate(self.to_glib_none().0, ref_.to_glib_none().0, checksum.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_set_collection_ref_immediate(self.to_glib_none().0, ref_.to_glib_none().0, checksum.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn set_disable_fsync(&self, disable_fsync: bool) {
+    pub fn set_disable_fsync(&self, disable_fsync: bool) {
         unsafe {
-            ffi::ostree_repo_set_disable_fsync(self.to_glib_none().0, disable_fsync.to_glib());
+            ostree_sys::ostree_repo_set_disable_fsync(self.to_glib_none().0, disable_fsync.to_glib());
         }
     }
 
-    fn set_ref_immediate<'a, 'b, 'c, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c gio::Cancellable>>>(&self, remote: P, ref_: &str, checksum: Q, cancellable: R) -> Result<(), Error> {
-        let remote = remote.into();
-        let remote = remote.to_glib_none();
-        let checksum = checksum.into();
-        let checksum = checksum.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn set_ref_immediate<P: IsA<gio::Cancellable>>(&self, remote: Option<&str>, ref_: &str, checksum: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_set_ref_immediate(self.to_glib_none().0, remote.0, ref_.to_glib_none().0, checksum.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_set_ref_immediate(self.to_glib_none().0, remote.to_glib_none().0, ref_.to_glib_none().0, checksum.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn sign_commit<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, commit_checksum: &str, key_id: &str, homedir: P, cancellable: Q) -> Result<(), Error> {
-        let homedir = homedir.into();
-        let homedir = homedir.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn sign_commit<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, key_id: &str, homedir: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_sign_commit(self.to_glib_none().0, commit_checksum.to_glib_none().0, key_id.to_glib_none().0, homedir.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_sign_commit(self.to_glib_none().0, commit_checksum.to_glib_none().0, key_id.to_glib_none().0, homedir.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn sign_delta<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, from_commit: &str, to_commit: &str, key_id: &str, homedir: &str, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn sign_delta<P: IsA<gio::Cancellable>>(&self, from_commit: &str, to_commit: &str, key_id: &str, homedir: &str, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_sign_delta(self.to_glib_none().0, from_commit.to_glib_none().0, to_commit.to_glib_none().0, key_id.to_glib_none().0, homedir.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_sign_delta(self.to_glib_none().0, from_commit.to_glib_none().0, to_commit.to_glib_none().0, key_id.to_glib_none().0, homedir.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn static_delta_execute_offline<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, dir_or_file: &P, skip_validation: bool, cancellable: Q) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn static_delta_execute_offline<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, dir_or_file: &P, skip_validation: bool, cancellable: Option<&Q>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_static_delta_execute_offline(self.to_glib_none().0, dir_or_file.to_glib_none().0, skip_validation.to_glib(), cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_static_delta_execute_offline(self.to_glib_none().0, dir_or_file.as_ref().to_glib_none().0, skip_validation.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn static_delta_generate<'a, 'b, 'c, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b glib::Variant>>, R: Into<Option<&'c gio::Cancellable>>>(&self, opt: StaticDeltaGenerateOpt, from: &str, to: &str, metadata: P, params: Q, cancellable: R) -> Result<(), Error> {
-        let metadata = metadata.into();
-        let metadata = metadata.to_glib_none();
-        let params = params.into();
-        let params = params.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn static_delta_generate<P: IsA<gio::Cancellable>>(&self, opt: StaticDeltaGenerateOpt, from: &str, to: &str, metadata: Option<&glib::Variant>, params: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_static_delta_generate(self.to_glib_none().0, opt.to_glib(), from.to_glib_none().0, to.to_glib_none().0, metadata.0, params.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_static_delta_generate(self.to_glib_none().0, opt.to_glib(), from.to_glib_none().0, to.to_glib_none().0, metadata.to_glib_none().0, params.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    fn transaction_set_collection_ref<'a, P: Into<Option<&'a str>>>(&self, ref_: &CollectionRef, checksum: P) {
-        let checksum = checksum.into();
-        let checksum = checksum.to_glib_none();
+    pub fn transaction_set_collection_ref(&self, ref_: &CollectionRef, checksum: Option<&str>) {
         unsafe {
-            ffi::ostree_repo_transaction_set_collection_ref(self.to_glib_none().0, ref_.to_glib_none().0, checksum.0);
+            ostree_sys::ostree_repo_transaction_set_collection_ref(self.to_glib_none().0, ref_.to_glib_none().0, checksum.to_glib_none().0);
         }
     }
 
-    fn transaction_set_ref<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(&self, remote: P, ref_: &str, checksum: Q) {
-        let remote = remote.into();
-        let remote = remote.to_glib_none();
-        let checksum = checksum.into();
-        let checksum = checksum.to_glib_none();
+    pub fn transaction_set_ref(&self, remote: Option<&str>, ref_: &str, checksum: Option<&str>) {
         unsafe {
-            ffi::ostree_repo_transaction_set_ref(self.to_glib_none().0, remote.0, ref_.to_glib_none().0, checksum.0);
+            ostree_sys::ostree_repo_transaction_set_ref(self.to_glib_none().0, remote.to_glib_none().0, ref_.to_glib_none().0, checksum.to_glib_none().0);
         }
     }
 
-    fn transaction_set_refspec<'a, P: Into<Option<&'a str>>>(&self, refspec: &str, checksum: P) {
-        let checksum = checksum.into();
-        let checksum = checksum.to_glib_none();
+    pub fn transaction_set_refspec(&self, refspec: &str, checksum: Option<&str>) {
         unsafe {
-            ffi::ostree_repo_transaction_set_refspec(self.to_glib_none().0, refspec.to_glib_none().0, checksum.0);
+            ostree_sys::ostree_repo_transaction_set_refspec(self.to_glib_none().0, refspec.to_glib_none().0, checksum.to_glib_none().0);
         }
     }
 
-    //fn traverse_commit<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, maxdepth: i32, out_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: P) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_traverse_commit() }
+    //pub fn traverse_commit<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, maxdepth: i32, out_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_traverse_commit() }
     //}
 
-    //fn traverse_commit_union<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, maxdepth: i32, inout_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, cancellable: P) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_traverse_commit_union() }
+    //pub fn traverse_commit_union<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, maxdepth: i32, inout_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_traverse_commit_union() }
     //}
 
     //#[cfg(any(feature = "v2018_5", feature = "dox"))]
-    //fn traverse_commit_union_with_parents<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, maxdepth: i32, inout_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, inout_parents: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, cancellable: P) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_traverse_commit_union_with_parents() }
+    //pub fn traverse_commit_union_with_parents<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, maxdepth: i32, inout_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, inout_parents: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_traverse_commit_union_with_parents() }
     //}
 
     //#[cfg(any(feature = "v2018_6", feature = "dox"))]
-    //fn traverse_reachable_refs<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, depth: u32, reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: P) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_traverse_reachable_refs() }
+    //pub fn traverse_reachable_refs<P: IsA<gio::Cancellable>>(&self, depth: u32, reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_traverse_reachable_refs() }
     //}
 
-    fn verify_commit<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: IsA<gio::File> + 'b, S: Into<Option<&'b R>>, T: Into<Option<&'c gio::Cancellable>>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result<(), Error> {
-        let keyringdir = keyringdir.into();
-        let keyringdir = keyringdir.to_glib_none();
-        let extra_keyring = extra_keyring.into();
-        let extra_keyring = extra_keyring.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn verify_commit<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(&self, commit_checksum: &str, keyringdir: Option<&P>, extra_keyring: Option<&Q>, cancellable: Option<&R>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_verify_commit(self.to_glib_none().0, commit_checksum.to_glib_none().0, keyringdir.0, extra_keyring.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_verify_commit(self.to_glib_none().0, commit_checksum.to_glib_none().0, keyringdir.map(|p| p.as_ref()).to_glib_none().0, extra_keyring.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn verify_commit_ext<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: IsA<gio::File> + 'b, S: Into<Option<&'b R>>, T: Into<Option<&'c gio::Cancellable>>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result<GpgVerifyResult, Error> {
-        let keyringdir = keyringdir.into();
-        let keyringdir = keyringdir.to_glib_none();
-        let extra_keyring = extra_keyring.into();
-        let extra_keyring = extra_keyring.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn verify_commit_ext<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(&self, commit_checksum: &str, keyringdir: Option<&P>, extra_keyring: Option<&Q>, cancellable: Option<&R>) -> Result<GpgVerifyResult, Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let ret = ffi::ostree_repo_verify_commit_ext(self.to_glib_none().0, commit_checksum.to_glib_none().0, keyringdir.0, extra_keyring.0, cancellable.0, &mut error);
+            let ret = ostree_sys::ostree_repo_verify_commit_ext(self.to_glib_none().0, commit_checksum.to_glib_none().0, keyringdir.map(|p| p.as_ref()).to_glib_none().0, extra_keyring.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2016_14", feature = "dox"))]
-    fn verify_commit_for_remote<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result<GpgVerifyResult, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn verify_commit_for_remote<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, remote_name: &str, cancellable: Option<&P>) -> Result<GpgVerifyResult, Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let ret = ffi::ostree_repo_verify_commit_for_remote(self.to_glib_none().0, commit_checksum.to_glib_none().0, remote_name.to_glib_none().0, cancellable.0, &mut error);
+            let ret = ostree_sys::ostree_repo_verify_commit_for_remote(self.to_glib_none().0, commit_checksum.to_glib_none().0, remote_name.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn verify_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, remote_name: &str, summary: &glib::Bytes, signatures: &glib::Bytes, cancellable: P) -> Result<GpgVerifyResult, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn verify_summary<P: IsA<gio::Cancellable>>(&self, remote_name: &str, summary: &glib::Bytes, signatures: &glib::Bytes, cancellable: Option<&P>) -> Result<GpgVerifyResult, Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let ret = ffi::ostree_repo_verify_summary(self.to_glib_none().0, remote_name.to_glib_none().0, summary.to_glib_none().0, signatures.to_glib_none().0, cancellable.0, &mut error);
+            let ret = ostree_sys::ostree_repo_verify_summary(self.to_glib_none().0, remote_name.to_glib_none().0, summary.to_glib_none().0, signatures.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn write_archive_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, archive: &P, mtree: &MutableTree, modifier: Q, autocreate_parents: bool, cancellable: R) -> Result<(), Error> {
-        let modifier = modifier.into();
-        let modifier = modifier.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_archive_to_mtree<P: IsA<gio::File>, Q: IsA<MutableTree>, R: IsA<gio::Cancellable>>(&self, archive: &P, mtree: &Q, modifier: Option<&RepoCommitModifier>, autocreate_parents: bool, cancellable: Option<&R>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_write_archive_to_mtree(self.to_glib_none().0, archive.to_glib_none().0, mtree.to_glib_none().0, modifier.0, autocreate_parents.to_glib(), cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_write_archive_to_mtree(self.to_glib_none().0, archive.as_ref().to_glib_none().0, mtree.as_ref().to_glib_none().0, modifier.to_glib_none().0, autocreate_parents.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn write_commit<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, cancellable: T) -> Result<String, Error> {
-        let parent = parent.into();
-        let parent = parent.to_glib_none();
-        let subject = subject.into();
-        let subject = subject.to_glib_none();
-        let body = body.into();
-        let body = body.to_glib_none();
-        let metadata = metadata.into();
-        let metadata = metadata.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_commit<P: IsA<RepoFile>, Q: IsA<gio::Cancellable>>(&self, parent: Option<&str>, subject: Option<&str>, body: Option<&str>, metadata: Option<&glib::Variant>, root: &P, cancellable: Option<&Q>) -> Result<GString, Error> {
         unsafe {
             let mut out_commit = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_write_commit(self.to_glib_none().0, parent.0, subject.0, body.0, metadata.0, root.to_glib_none().0, &mut out_commit, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_write_commit(self.to_glib_none().0, parent.to_glib_none().0, subject.to_glib_none().0, body.to_glib_none().0, metadata.to_glib_none().0, root.as_ref().to_glib_none().0, &mut out_commit, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_commit)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn write_commit_detached_metadata<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, checksum: &str, metadata: P, cancellable: Q) -> Result<(), Error> {
-        let metadata = metadata.into();
-        let metadata = metadata.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_commit_detached_metadata<P: IsA<gio::Cancellable>>(&self, checksum: &str, metadata: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_write_commit_detached_metadata(self.to_glib_none().0, checksum.to_glib_none().0, metadata.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_write_commit_detached_metadata(self.to_glib_none().0, checksum.to_glib_none().0, metadata.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn write_commit_with_time<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, time: u64, cancellable: T) -> Result<String, Error> {
-        let parent = parent.into();
-        let parent = parent.to_glib_none();
-        let subject = subject.into();
-        let subject = subject.to_glib_none();
-        let body = body.into();
-        let body = body.to_glib_none();
-        let metadata = metadata.into();
-        let metadata = metadata.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_commit_with_time<P: IsA<RepoFile>, Q: IsA<gio::Cancellable>>(&self, parent: Option<&str>, subject: Option<&str>, body: Option<&str>, metadata: Option<&glib::Variant>, root: &P, time: u64, cancellable: Option<&Q>) -> Result<GString, Error> {
         unsafe {
             let mut out_commit = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_write_commit_with_time(self.to_glib_none().0, parent.0, subject.0, body.0, metadata.0, root.to_glib_none().0, time, &mut out_commit, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_write_commit_with_time(self.to_glib_none().0, parent.to_glib_none().0, subject.to_glib_none().0, body.to_glib_none().0, metadata.to_glib_none().0, root.as_ref().to_glib_none().0, time, &mut out_commit, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_commit)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn write_config(&self, new_config: &glib::KeyFile) -> Result<(), Error> {
+    pub fn write_config(&self, new_config: &glib::KeyFile) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_write_config(self.to_glib_none().0, new_config.to_glib_none().0, &mut error);
+            let _ = ostree_sys::ostree_repo_write_config(self.to_glib_none().0, new_config.to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    //fn write_content<'a, 'b, P: Into<Option<&'a str>>, Q: IsA<gio::InputStream>, R: Into<Option<&'b gio::Cancellable>>>(&self, expected_checksum: P, object_input: &Q, length: u64, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: R) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_write_content() }
+    //pub fn write_content<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, expected_checksum: Option<&str>, object_input: &P, length: u64, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&Q>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_write_content() }
     //}
 
-    fn write_content_trusted<'a, P: IsA<gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_content_trusted<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Option<&Q>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_write_content_trusted(self.to_glib_none().0, checksum.to_glib_none().0, object_input.to_glib_none().0, length, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_write_content_trusted(self.to_glib_none().0, checksum.to_glib_none().0, object_input.as_ref().to_glib_none().0, length, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn write_dfd_to_mtree<'a, 'b, P: Into<Option<&'a RepoCommitModifier>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, dfd: i32, path: &str, mtree: &MutableTree, modifier: P, cancellable: Q) -> Result<(), Error> {
-        let modifier = modifier.into();
-        let modifier = modifier.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_dfd_to_mtree<P: IsA<MutableTree>, Q: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, mtree: &P, modifier: Option<&RepoCommitModifier>, cancellable: Option<&Q>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_write_dfd_to_mtree(self.to_glib_none().0, dfd, path.to_glib_none().0, mtree.to_glib_none().0, modifier.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_write_dfd_to_mtree(self.to_glib_none().0, dfd, path.to_glib_none().0, mtree.as_ref().to_glib_none().0, modifier.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn write_directory_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, dir: &P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error> {
-        let modifier = modifier.into();
-        let modifier = modifier.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_directory_to_mtree<P: IsA<gio::File>, Q: IsA<MutableTree>, R: IsA<gio::Cancellable>>(&self, dir: &P, mtree: &Q, modifier: Option<&RepoCommitModifier>, cancellable: Option<&R>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_write_directory_to_mtree(self.to_glib_none().0, dir.to_glib_none().0, mtree.to_glib_none().0, modifier.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_write_directory_to_mtree(self.to_glib_none().0, dir.as_ref().to_glib_none().0, mtree.as_ref().to_glib_none().0, modifier.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    //fn write_metadata<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, objtype: ObjectType, expected_checksum: P, object: &glib::Variant, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Q) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_repo_write_metadata() }
+    //pub fn write_metadata<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, expected_checksum: Option<&str>, object: &glib::Variant, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_write_metadata() }
     //}
 
-    fn write_metadata_stream_trusted<'a, P: IsA<gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_metadata_stream_trusted<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Option<&Q>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_write_metadata_stream_trusted(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, object_input.to_glib_none().0, length, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_write_metadata_stream_trusted(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, object_input.as_ref().to_glib_none().0, length, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn write_metadata_trusted<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, variant: &glib::Variant, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_metadata_trusted<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, variant: &glib::Variant, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_write_metadata_trusted(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, variant.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_write_metadata_trusted(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, variant.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn write_mtree<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, mtree: &MutableTree, cancellable: P) -> Result<gio::File, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_mtree<P: IsA<MutableTree>, Q: IsA<gio::Cancellable>>(&self, mtree: &P, cancellable: Option<&Q>) -> Result<gio::File, Error> {
         unsafe {
             let mut out_file = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_write_mtree(self.to_glib_none().0, mtree.to_glib_none().0, &mut out_file, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_write_mtree(self.to_glib_none().0, mtree.as_ref().to_glib_none().0, &mut out_file, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_file)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn get_property_remotes_config_dir(&self) -> Option<String> {
+    pub fn get_property_remotes_config_dir(&self) -> Option<GString> {
         unsafe {
-            let mut value = Value::from_type(<String as StaticType>::static_type());
-            gobject_ffi::g_object_get_property(self.to_glib_none().0, "remotes-config-dir".to_glib_none().0, value.to_glib_none_mut().0);
+            let mut value = Value::from_type(<GString as StaticType>::static_type());
+            gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"remotes-config-dir\0".as_ptr() as *const _, value.to_glib_none_mut().0);
             value.get()
         }
     }
 
-    fn get_property_sysroot_path(&self) -> Option<gio::File> {
+    pub fn get_property_sysroot_path(&self) -> Option<gio::File> {
         unsafe {
             let mut value = Value::from_type(<gio::File as StaticType>::static_type());
-            gobject_ffi::g_object_get_property(self.to_glib_none().0, "sysroot-path".to_glib_none().0, value.to_glib_none_mut().0);
+            gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"sysroot-path\0".as_ptr() as *const _, value.to_glib_none_mut().0);
             value.get()
         }
     }
 
-    fn connect_gpg_verify_result<F: Fn(&Self, &str, &GpgVerifyResult) + 'static>(&self, f: F) -> SignalHandlerId {
+    #[cfg(any(feature = "v2017_10", feature = "dox"))]
+    pub fn create_at<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, mode: RepoMode, options: &glib::Variant, cancellable: Option<&P>) -> Result<Repo, Error> {
         unsafe {
-            let f: Box_<Box_<Fn(&Self, &str, &GpgVerifyResult) + 'static>> = Box_::new(Box_::new(f));
-            connect(self.to_glib_none().0, "gpg-verify-result",
-                transmute(gpg_verify_result_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
+            let mut error = ptr::null_mut();
+            let ret = ostree_sys::ostree_repo_create_at(dfd, path.to_glib_none().0, mode.to_glib(), options.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+            if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
+        }
+    }
+
+    pub fn mode_from_string(mode: &str) -> Result<RepoMode, Error> {
+        unsafe {
+            let mut out_mode = mem::uninitialized();
+            let mut error = ptr::null_mut();
+            let _ = ostree_sys::ostree_repo_mode_from_string(mode.to_glib_none().0, &mut out_mode, &mut error);
+            if error.is_null() { Ok(from_glib(out_mode)) } else { Err(from_glib_full(error)) }
+        }
+    }
+
+    #[cfg(any(feature = "v2017_10", feature = "dox"))]
+    pub fn open_at<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, cancellable: Option<&P>) -> Result<Repo, Error> {
+        unsafe {
+            let mut error = ptr::null_mut();
+            let ret = ostree_sys::ostree_repo_open_at(dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+            if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
+        }
+    }
+
+    //pub fn pull_default_console_progress_changed<P: IsA<AsyncProgress>>(progress: &P, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_pull_default_console_progress_changed() }
+    //}
+
+    //#[cfg(any(feature = "v2018_5", feature = "dox"))]
+    //pub fn traverse_new_parents() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 } {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_traverse_new_parents() }
+    //}
+
+    //pub fn traverse_new_reachable() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 } {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_traverse_new_reachable() }
+    //}
+
+    //#[cfg(any(feature = "v2018_5", feature = "dox"))]
+    //pub fn traverse_parents_get_commits(parents: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, object: &glib::Variant) -> Vec<GString> {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_traverse_parents_get_commits() }
+    //}
+
+    pub fn connect_gpg_verify_result<F: Fn(&Repo, &str, &GpgVerifyResult) + 'static>(&self, f: F) -> SignalHandlerId {
+        unsafe {
+            let f: Box_<F> = Box_::new(f);
+            connect_raw(self.as_ptr() as *mut _, b"gpg-verify-result\0".as_ptr() as *const _,
+                Some(transmute(gpg_verify_result_trampoline::<F> as usize)), Box_::into_raw(f))
         }
     }
 }
 
-unsafe extern "C" fn gpg_verify_result_trampoline<P>(this: *mut ffi::OstreeRepo, checksum: *mut libc::c_char, result: *mut ffi::OstreeGpgVerifyResult, f: glib_ffi::gpointer)
-where P: IsA<Repo> {
-    let f: &&(Fn(&P, &str, &GpgVerifyResult) + 'static) = transmute(f);
-    f(&Repo::from_glib_borrow(this).downcast_unchecked(), &String::from_glib_none(checksum), &from_glib_borrow(result))
+unsafe extern "C" fn gpg_verify_result_trampoline<F: Fn(&Repo, &str, &GpgVerifyResult) + 'static>(this: *mut ostree_sys::OstreeRepo, checksum: *mut libc::c_char, result: *mut ostree_sys::OstreeGpgVerifyResult, f: glib_sys::gpointer) {
+    let f: &F = &*(f as *const F);
+    f(&from_glib_borrow(this), &GString::from_glib_borrow(checksum), &from_glib_borrow(result))
+}
+
+impl fmt::Display for Repo {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "Repo")
+    }
 }
index e4c02fc6cadc37d92e34b075bc0282890f207510..9854cee71de6077e88ada1f0be5ae38fbe5167de 100644 (file)
@@ -2,48 +2,64 @@
 // from gir-files (https://github.com/gtk-rs/gir-files)
 // DO NOT EDIT
 
+use Repo;
 #[cfg(any(feature = "v2017_13", feature = "dox"))]
 use RepoDevInoCache;
 use SePolicy;
-use ffi;
+use gio;
+use glib;
+use glib::GString;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
-use std::mem;
-use std::ptr;
+use ostree_sys;
+use std::boxed::Box as Box_;
 
 glib_wrapper! {
     #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
-    pub struct RepoCommitModifier(Shared<ffi::OstreeRepoCommitModifier>);
+    pub struct RepoCommitModifier(Shared<ostree_sys::OstreeRepoCommitModifier>);
 
     match fn {
-        ref => |ptr| ffi::ostree_repo_commit_modifier_ref(ptr),
-        unref => |ptr| ffi::ostree_repo_commit_modifier_unref(ptr),
-        get_type => || ffi::ostree_repo_commit_modifier_get_type(),
+        ref => |ptr| ostree_sys::ostree_repo_commit_modifier_ref(ptr),
+        unref => |ptr| ostree_sys::ostree_repo_commit_modifier_unref(ptr),
+        get_type => || ostree_sys::ostree_repo_commit_modifier_get_type(),
     }
 }
 
 impl RepoCommitModifier {
-    //pub fn new<'a, P: Into<Option<&'a /*Unimplemented*/RepoCommitFilter>>>(flags: /*Ignored*/RepoCommitModifierFlags, commit_filter: P, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> RepoCommitModifier {
-    //    unsafe { TODO: call ffi::ostree_repo_commit_modifier_new() }
+    //pub fn new(flags: /*Ignored*/RepoCommitModifierFlags, commit_filter: /*Unimplemented*/Fn(&Repo, &str, &gio::FileInfo) -> /*Ignored*/RepoCommitFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> RepoCommitModifier {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_commit_modifier_new() }
     //}
 
     #[cfg(any(feature = "v2017_13", feature = "dox"))]
     pub fn set_devino_cache(&self, cache: &RepoDevInoCache) {
         unsafe {
-            ffi::ostree_repo_commit_modifier_set_devino_cache(self.to_glib_none().0, cache.to_glib_none().0);
+            ostree_sys::ostree_repo_commit_modifier_set_devino_cache(self.to_glib_none().0, cache.to_glib_none().0);
         }
     }
 
-    pub fn set_sepolicy<'a, P: Into<Option<&'a SePolicy>>>(&self, sepolicy: P) {
-        let sepolicy = sepolicy.into();
-        let sepolicy = sepolicy.to_glib_none();
+    pub fn set_sepolicy(&self, sepolicy: Option<&SePolicy>) {
         unsafe {
-            ffi::ostree_repo_commit_modifier_set_sepolicy(self.to_glib_none().0, sepolicy.0);
+            ostree_sys::ostree_repo_commit_modifier_set_sepolicy(self.to_glib_none().0, sepolicy.to_glib_none().0);
         }
     }
 
-    //pub fn set_xattr_callback(&self, callback: /*Unknown conversion*//*Unimplemented*/RepoCommitModifierXattrCallback, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
-    //    unsafe { TODO: call ffi::ostree_repo_commit_modifier_set_xattr_callback() }
-    //}
+    pub fn set_xattr_callback<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(&self, callback: P) {
+        let callback_data: Box_<P> = Box::new(callback);
+        unsafe extern "C" fn callback_func<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(repo: *mut ostree_sys::OstreeRepo, path: *const libc::c_char, file_info: *mut gio_sys::GFileInfo, user_data: glib_sys::gpointer) -> *mut glib_sys::GVariant {
+            let repo = from_glib_borrow(repo);
+            let path: GString = from_glib_borrow(path);
+            let file_info = from_glib_borrow(file_info);
+            let callback: &P = &*(user_data as *mut _);
+            let res = (*callback)(&repo, path.as_str(), &file_info);
+            res.to_glib_full()
+        }
+        let callback = Some(callback_func::<P> as _);
+        unsafe extern "C" fn destroy_func<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(data: glib_sys::gpointer) {
+            let _callback: Box_<P> = Box_::from_raw(data as *mut _);
+        }
+        let destroy_call2 = Some(destroy_func::<P> as _);
+        let super_callback0: Box_<P> = callback_data;
+        unsafe {
+            ostree_sys::ostree_repo_commit_modifier_set_xattr_callback(self.to_glib_none().0, callback, destroy_call2, Box::into_raw(super_callback0) as *mut _);
+        }
+    }
 }
index 94c5a3b051a1dae09a0dc72bfaa0ab278d8492f1..70ca418bdf8dc439b9269df60e2c61e7bf75f154 100644 (file)
@@ -2,28 +2,24 @@
 // from gir-files (https://github.com/gtk-rs/gir-files)
 // DO NOT EDIT
 
-use ffi;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
-use std::mem;
-use std::ptr;
+use ostree_sys;
 
 glib_wrapper! {
     #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
-    pub struct RepoDevInoCache(Shared<ffi::OstreeRepoDevInoCache>);
+    pub struct RepoDevInoCache(Shared<ostree_sys::OstreeRepoDevInoCache>);
 
     match fn {
-        ref => |ptr| ffi::ostree_repo_devino_cache_ref(ptr),
-        unref => |ptr| ffi::ostree_repo_devino_cache_unref(ptr),
-        get_type => || ffi::ostree_repo_devino_cache_get_type(),
+        ref => |ptr| ostree_sys::ostree_repo_devino_cache_ref(ptr),
+        unref => |ptr| ostree_sys::ostree_repo_devino_cache_unref(ptr),
+        get_type => || ostree_sys::ostree_repo_devino_cache_get_type(),
     }
 }
 
 impl RepoDevInoCache {
     pub fn new() -> RepoDevInoCache {
         unsafe {
-            from_glib_full(ffi::ostree_repo_devino_cache_new())
+            from_glib_full(ostree_sys::ostree_repo_devino_cache_new())
         }
     }
 }
index 500023feb201a2c00e5fc156e9f1cde207a30e05..d7e7b81e5cf9a360ff5203ff979facd734517dea 100644 (file)
@@ -4,49 +4,48 @@
 
 use Error;
 use Repo;
-use ffi;
 use gio;
-use gio_ffi;
 use glib;
+use glib::GString;
 use glib::object::IsA;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
+use ostree_sys;
+use std::fmt;
 use std::mem;
 use std::ptr;
 
 glib_wrapper! {
-    pub struct RepoFile(Object<ffi::OstreeRepoFile, ffi::OstreeRepoFileClass>): [
-        gio::File => gio_ffi::GFile,
-    ];
+    pub struct RepoFile(Object<ostree_sys::OstreeRepoFile, ostree_sys::OstreeRepoFileClass, RepoFileClass>) @implements gio::File;
 
     match fn {
-        get_type => || ffi::ostree_repo_file_get_type(),
+        get_type => || ostree_sys::ostree_repo_file_get_type(),
     }
 }
 
-pub trait RepoFileExt {
+pub const NONE_REPO_FILE: Option<&RepoFile> = None;
+
+pub trait RepoFileExt: 'static {
     fn ensure_resolved(&self) -> Result<(), Error>;
 
-    fn get_checksum(&self) -> Option<String>;
+    fn get_checksum(&self) -> Option<GString>;
 
     fn get_repo(&self) -> Option<Repo>;
 
     fn get_root(&self) -> Option<RepoFile>;
 
-    fn get_xattrs<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<glib::Variant, Error>;
+    fn get_xattrs<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<glib::Variant, Error>;
 
     fn tree_find_child(&self, name: &str) -> (i32, bool, glib::Variant);
 
     fn tree_get_contents(&self) -> Option<glib::Variant>;
 
-    fn tree_get_contents_checksum(&self) -> Option<String>;
+    fn tree_get_contents_checksum(&self) -> Option<GString>;
 
     fn tree_get_metadata(&self) -> Option<glib::Variant>;
 
-    fn tree_get_metadata_checksum(&self) -> Option<String>;
+    fn tree_get_metadata_checksum(&self) -> Option<GString>;
 
-    fn tree_query_child<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: P) -> Result<gio::FileInfo, Error>;
+    fn tree_query_child<P: IsA<gio::Cancellable>>(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: Option<&P>) -> Result<gio::FileInfo, Error>;
 
     fn tree_set_metadata(&self, checksum: &str, metadata: &glib::Variant);
 }
@@ -55,36 +54,34 @@ impl<O: IsA<RepoFile>> RepoFileExt for O {
     fn ensure_resolved(&self) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_file_ensure_resolved(self.to_glib_none().0, &mut error);
+            let _ = ostree_sys::ostree_repo_file_ensure_resolved(self.as_ref().to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn get_checksum(&self) -> Option<String> {
+    fn get_checksum(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_repo_file_get_checksum(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_repo_file_get_checksum(self.as_ref().to_glib_none().0))
         }
     }
 
     fn get_repo(&self) -> Option<Repo> {
         unsafe {
-            from_glib_none(ffi::ostree_repo_file_get_repo(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_repo_file_get_repo(self.as_ref().to_glib_none().0))
         }
     }
 
     fn get_root(&self) -> Option<RepoFile> {
         unsafe {
-            from_glib_none(ffi::ostree_repo_file_get_root(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_repo_file_get_root(self.as_ref().to_glib_none().0))
         }
     }
 
-    fn get_xattrs<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<glib::Variant, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    fn get_xattrs<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<glib::Variant, Error> {
         unsafe {
             let mut out_xattrs = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_file_get_xattrs(self.to_glib_none().0, &mut out_xattrs, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_file_get_xattrs(self.as_ref().to_glib_none().0, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_xattrs)) } else { Err(from_glib_full(error)) }
         }
     }
@@ -93,49 +90,53 @@ impl<O: IsA<RepoFile>> RepoFileExt for O {
         unsafe {
             let mut is_dir = mem::uninitialized();
             let mut out_container = ptr::null_mut();
-            let ret = ffi::ostree_repo_file_tree_find_child(self.to_glib_none().0, name.to_glib_none().0, &mut is_dir, &mut out_container);
+            let ret = ostree_sys::ostree_repo_file_tree_find_child(self.as_ref().to_glib_none().0, name.to_glib_none().0, &mut is_dir, &mut out_container);
             (ret, from_glib(is_dir), from_glib_full(out_container))
         }
     }
 
     fn tree_get_contents(&self) -> Option<glib::Variant> {
         unsafe {
-            from_glib_full(ffi::ostree_repo_file_tree_get_contents(self.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_repo_file_tree_get_contents(self.as_ref().to_glib_none().0))
         }
     }
 
-    fn tree_get_contents_checksum(&self) -> Option<String> {
+    fn tree_get_contents_checksum(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_repo_file_tree_get_contents_checksum(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_repo_file_tree_get_contents_checksum(self.as_ref().to_glib_none().0))
         }
     }
 
     fn tree_get_metadata(&self) -> Option<glib::Variant> {
         unsafe {
-            from_glib_full(ffi::ostree_repo_file_tree_get_metadata(self.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_repo_file_tree_get_metadata(self.as_ref().to_glib_none().0))
         }
     }
 
-    fn tree_get_metadata_checksum(&self) -> Option<String> {
+    fn tree_get_metadata_checksum(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_repo_file_tree_get_metadata_checksum(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_repo_file_tree_get_metadata_checksum(self.as_ref().to_glib_none().0))
         }
     }
 
-    fn tree_query_child<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: P) -> Result<gio::FileInfo, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    fn tree_query_child<P: IsA<gio::Cancellable>>(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: Option<&P>) -> Result<gio::FileInfo, Error> {
         unsafe {
             let mut out_info = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_repo_file_tree_query_child(self.to_glib_none().0, n, attributes.to_glib_none().0, flags.to_glib(), &mut out_info, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_repo_file_tree_query_child(self.as_ref().to_glib_none().0, n, attributes.to_glib_none().0, flags.to_glib(), &mut out_info, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_info)) } else { Err(from_glib_full(error)) }
         }
     }
 
     fn tree_set_metadata(&self, checksum: &str, metadata: &glib::Variant) {
         unsafe {
-            ffi::ostree_repo_file_tree_set_metadata(self.to_glib_none().0, checksum.to_glib_none().0, metadata.to_glib_none().0);
+            ostree_sys::ostree_repo_file_tree_set_metadata(self.as_ref().to_glib_none().0, checksum.to_glib_none().0, metadata.to_glib_none().0);
         }
     }
 }
+
+impl fmt::Display for RepoFile {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "RepoFile")
+    }
+}
index 5f94acf3accd10fe3eee77305ece1916e775d36b..1011c4ae6566f17d4fc8b70c5c785b5182e33809 100644 (file)
@@ -2,20 +2,16 @@
 // from gir-files (https://github.com/gtk-rs/gir-files)
 // DO NOT EDIT
 
-use ffi;
-use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
-use std::mem;
-use std::ptr;
+use gobject_sys;
+use ostree_sys;
 
 glib_wrapper! {
     #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
-    pub struct RepoTransactionStats(Boxed<ffi::OstreeRepoTransactionStats>);
+    pub struct RepoTransactionStats(Boxed<ostree_sys::OstreeRepoTransactionStats>);
 
     match fn {
-        copy => |ptr| gobject_ffi::g_boxed_copy(ffi::ostree_repo_transaction_stats_get_type(), ptr as *mut _) as *mut ffi::OstreeRepoTransactionStats,
-        free => |ptr| gobject_ffi::g_boxed_free(ffi::ostree_repo_transaction_stats_get_type(), ptr as *mut _),
-        get_type => || ffi::ostree_repo_transaction_stats_get_type(),
+        copy => |ptr| gobject_sys::g_boxed_copy(ostree_sys::ostree_repo_transaction_stats_get_type(), ptr as *mut _) as *mut ostree_sys::OstreeRepoTransactionStats,
+        free => |ptr| gobject_sys::g_boxed_free(ostree_sys::ostree_repo_transaction_stats_get_type(), ptr as *mut _),
+        get_type => || ostree_sys::ostree_repo_transaction_stats_get_type(),
     }
 }
index 588895b21fa9267c01a4329d779e3fd699b76175..f52c953563482c7fdc974c2d02fbf217f0de723c 100644 (file)
 
 use Error;
 use SePolicyRestoreconFlags;
-use ffi;
 use gio;
-use glib;
+use glib::GString;
 use glib::StaticType;
 use glib::Value;
 use glib::object::IsA;
+use glib::object::ObjectType as _;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
-use std::mem;
+use gobject_sys;
+use ostree_sys;
+use std::fmt;
 use std::ptr;
 
 glib_wrapper! {
-    pub struct SePolicy(Object<ffi::OstreeSePolicy>);
+    pub struct SePolicy(Object<ostree_sys::OstreeSePolicy, SePolicyClass>);
 
     match fn {
-        get_type => || ffi::ostree_sepolicy_get_type(),
+        get_type => || ostree_sys::ostree_sepolicy_get_type(),
     }
 }
 
 impl SePolicy {
-    pub fn new<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(path: &P, cancellable: Q) -> Result<SePolicy, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn new<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(path: &P, cancellable: Option<&Q>) -> Result<SePolicy, Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let ret = ffi::ostree_sepolicy_new(path.to_glib_none().0, cancellable.0, &mut error);
+            let ret = ostree_sys::ostree_sepolicy_new(path.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2017_4", feature = "dox"))]
-    pub fn new_at<'a, P: Into<Option<&'a gio::Cancellable>>>(rootfs_dfd: i32, cancellable: P) -> Result<SePolicy, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn new_at<P: IsA<gio::Cancellable>>(rootfs_dfd: i32, cancellable: Option<&P>) -> Result<SePolicy, Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let ret = ffi::ostree_sepolicy_new_at(rootfs_dfd, cancellable.0, &mut error);
+            let ret = ostree_sys::ostree_sepolicy_new_at(rootfs_dfd, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    //pub fn fscreatecon_cleanup<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(unused: P) {
-    //    unsafe { TODO: call ffi::ostree_sepolicy_fscreatecon_cleanup() }
-    //}
-}
-
-pub trait SePolicyExt {
     #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn get_csum(&self) -> Option<String>;
-
-    fn get_label<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, relpath: &str, unix_mode: u32, cancellable: P) -> Result<String, Error>;
-
-    fn get_name(&self) -> Option<String>;
-
-    fn get_path(&self) -> Option<gio::File>;
-
-    fn restorecon<'a, 'b, P: Into<Option<&'a gio::FileInfo>>, Q: IsA<gio::File>, R: Into<Option<&'b gio::Cancellable>>>(&self, path: &str, info: P, target: &Q, flags: SePolicyRestoreconFlags, cancellable: R) -> Result<String, Error>;
-
-    fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), Error>;
-
-    fn get_property_rootfs_dfd(&self) -> i32;
-}
-
-impl<O: IsA<SePolicy> + IsA<glib::object::Object>> SePolicyExt for O {
-    #[cfg(any(feature = "v2016_5", feature = "dox"))]
-    fn get_csum(&self) -> Option<String> {
+    pub fn get_csum(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_sepolicy_get_csum(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_sepolicy_get_csum(self.to_glib_none().0))
         }
     }
 
-    fn get_label<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, relpath: &str, unix_mode: u32, cancellable: P) -> Result<String, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn get_label<P: IsA<gio::Cancellable>>(&self, relpath: &str, unix_mode: u32, cancellable: Option<&P>) -> Result<GString, Error> {
         unsafe {
             let mut out_label = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sepolicy_get_label(self.to_glib_none().0, relpath.to_glib_none().0, unix_mode, &mut out_label, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sepolicy_get_label(self.to_glib_none().0, relpath.to_glib_none().0, unix_mode, &mut out_label, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_label)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn get_name(&self) -> Option<String> {
+    pub fn get_name(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_sepolicy_get_name(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_sepolicy_get_name(self.to_glib_none().0))
         }
     }
 
-    fn get_path(&self) -> Option<gio::File> {
+    pub fn get_path(&self) -> Option<gio::File> {
         unsafe {
-            from_glib_none(ffi::ostree_sepolicy_get_path(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_sepolicy_get_path(self.to_glib_none().0))
         }
     }
 
-    fn restorecon<'a, 'b, P: Into<Option<&'a gio::FileInfo>>, Q: IsA<gio::File>, R: Into<Option<&'b gio::Cancellable>>>(&self, path: &str, info: P, target: &Q, flags: SePolicyRestoreconFlags, cancellable: R) -> Result<String, Error> {
-        let info = info.into();
-        let info = info.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn restorecon<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, path: &str, info: Option<&gio::FileInfo>, target: &P, flags: SePolicyRestoreconFlags, cancellable: Option<&Q>) -> Result<GString, Error> {
         unsafe {
             let mut out_new_label = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sepolicy_restorecon(self.to_glib_none().0, path.to_glib_none().0, info.0, target.to_glib_none().0, flags.to_glib(), &mut out_new_label, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sepolicy_restorecon(self.to_glib_none().0, path.to_glib_none().0, info.to_glib_none().0, target.as_ref().to_glib_none().0, flags.to_glib(), &mut out_new_label, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_new_label)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), Error> {
+    pub fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sepolicy_setfscreatecon(self.to_glib_none().0, path.to_glib_none().0, mode, &mut error);
+            let _ = ostree_sys::ostree_sepolicy_setfscreatecon(self.to_glib_none().0, path.to_glib_none().0, mode, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn get_property_rootfs_dfd(&self) -> i32 {
+    pub fn get_property_rootfs_dfd(&self) -> i32 {
         unsafe {
             let mut value = Value::from_type(<i32 as StaticType>::static_type());
-            gobject_ffi::g_object_get_property(self.to_glib_none().0, "rootfs-dfd".to_glib_none().0, value.to_glib_none_mut().0);
+            gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"rootfs-dfd\0".as_ptr() as *const _, value.to_glib_none_mut().0);
             value.get().unwrap()
         }
     }
+
+    //pub fn fscreatecon_cleanup(unused: /*Unimplemented*/Option<Fundamental: Pointer>) {
+    //    unsafe { TODO: call ostree_sys:ostree_sepolicy_fscreatecon_cleanup() }
+    //}
+}
+
+impl fmt::Display for SePolicy {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "SePolicy")
+    }
 }
index 087b26943b069dbdde89973b0d672c2203f1dd2b..60eae2198728f0bba5c10f581d9ee453b50d1751 100644 (file)
@@ -8,508 +8,365 @@ use DeploymentUnlockedState;
 use Error;
 use Repo;
 use SysrootSimpleWriteDeploymentFlags;
-use ffi;
 #[cfg(feature = "futures")]
-use futures_core;
+use futures::future;
 use gio;
-use gio_ffi;
+use gio_sys;
 use glib;
-#[cfg(any(feature = "v2017_10", feature = "dox"))]
-use glib::object::Downcast;
+use glib::GString;
 use glib::object::IsA;
 #[cfg(any(feature = "v2017_10", feature = "dox"))]
+use glib::object::ObjectType as _;
+#[cfg(any(feature = "v2017_10", feature = "dox"))]
 use glib::signal::SignalHandlerId;
 #[cfg(any(feature = "v2017_10", feature = "dox"))]
-use glib::signal::connect;
+use glib::signal::connect_raw;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
+use glib_sys;
+use gobject_sys;
 #[cfg(any(feature = "v2017_10", feature = "dox"))]
 use libc;
+use ostree_sys;
 use std::boxed::Box as Box_;
+use std::fmt;
 use std::mem;
 #[cfg(any(feature = "v2017_10", feature = "dox"))]
 use std::mem::transmute;
 use std::ptr;
 
 glib_wrapper! {
-    pub struct Sysroot(Object<ffi::OstreeSysroot>);
+    pub struct Sysroot(Object<ostree_sys::OstreeSysroot, SysrootClass>);
 
     match fn {
-        get_type => || ffi::ostree_sysroot_get_type(),
+        get_type => || ostree_sys::ostree_sysroot_get_type(),
     }
 }
 
 impl Sysroot {
-    pub fn new<'a, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>>(path: Q) -> Sysroot {
-        let path = path.into();
-        let path = path.to_glib_none();
+    pub fn new<P: IsA<gio::File>>(path: Option<&P>) -> Sysroot {
         unsafe {
-            from_glib_full(ffi::ostree_sysroot_new(path.0))
+            from_glib_full(ostree_sys::ostree_sysroot_new(path.map(|p| p.as_ref()).to_glib_none().0))
         }
     }
 
     pub fn new_default() -> Sysroot {
         unsafe {
-            from_glib_full(ffi::ostree_sysroot_new_default())
+            from_glib_full(ostree_sys::ostree_sysroot_new_default())
         }
     }
 
-    pub fn get_deployment_origin_path<P: IsA<gio::File>>(deployment_path: &P) -> Option<gio::File> {
-        unsafe {
-            from_glib_full(ffi::ostree_sysroot_get_deployment_origin_path(deployment_path.to_glib_none().0))
-        }
-    }
-}
-
-pub trait SysrootExt: Sized {
-    fn cleanup<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
-
-    //#[cfg(any(feature = "v2018_6", feature = "dox"))]
-    //fn cleanup_prune_repo<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: P) -> Result<(i32, i32, u64), Error>;
-
-    fn deploy_tree<'a, 'b, 'c, 'd, P: Into<Option<&'a str>>, Q: Into<Option<&'b glib::KeyFile>>, R: Into<Option<&'c Deployment>>, S: Into<Option<&'d gio::Cancellable>>>(&self, osname: P, revision: &str, origin: Q, provided_merge_deployment: R, override_kernel_argv: &[&str], cancellable: S) -> Result<Deployment, Error>;
-
-    fn deployment_set_kargs<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, deployment: &Deployment, new_kargs: &[&str], cancellable: P) -> Result<(), Error>;
-
-    fn deployment_set_mutable<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, deployment: &Deployment, is_mutable: bool, cancellable: P) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2018_3", feature = "dox"))]
-    fn deployment_set_pinned(&self, deployment: &Deployment, is_pinned: bool) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn deployment_unlock<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, deployment: &Deployment, unlocked_state: DeploymentUnlockedState, cancellable: P) -> Result<(), Error>;
-
-    fn ensure_initialized<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
-
-    fn get_booted_deployment(&self) -> Option<Deployment>;
-
-    fn get_bootversion(&self) -> i32;
-
-    fn get_deployment_directory(&self, deployment: &Deployment) -> Option<gio::File>;
-
-    fn get_deployment_dirpath(&self, deployment: &Deployment) -> Option<String>;
-
-    //fn get_deployments(&self) -> /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 19 };
-
-    fn get_fd(&self) -> i32;
-
-    fn get_merge_deployment<'a, P: Into<Option<&'a str>>>(&self, osname: P) -> Option<Deployment>;
-
-    fn get_path(&self) -> Option<gio::File>;
-
-    fn get_repo<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<Repo, Error>;
-
-    #[cfg(any(feature = "v2018_5", feature = "dox"))]
-    fn get_staged_deployment(&self) -> Option<Deployment>;
-
-    fn get_subbootversion(&self) -> i32;
-
-    #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn init_osname<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, osname: &str, cancellable: P) -> Result<(), Error>;
-
-    fn load<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn load_if_changed<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<bool, Error>;
-
-    fn lock(&self) -> Result<(), Error>;
-
-    fn lock_async<'a, P: Into<Option<&'a gio::Cancellable>>, Q: FnOnce(Result<(), Error>) + Send + 'static>(&self, cancellable: P, callback: Q);
-
-    #[cfg(feature = "futures")]
-    fn lock_async_future(&self) -> Box_<futures_core::Future<Item = (Self, ()), Error = (Self, Error)>>;
-
-    fn origin_new_from_refspec(&self, refspec: &str) -> Option<glib::KeyFile>;
-
-    fn prepare_cleanup<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2017_7", feature = "dox"))]
-    fn query_deployments_for<'a, P: Into<Option<&'a str>>>(&self, osname: P) -> (Deployment, Deployment);
-
-    #[cfg(any(feature = "v2017_7", feature = "dox"))]
-    fn repo(&self) -> Option<Repo>;
-
-    fn simple_write_deployment<'a, 'b, 'c, P: Into<Option<&'a str>>, Q: Into<Option<&'b Deployment>>, R: Into<Option<&'c gio::Cancellable>>>(&self, osname: P, new_deployment: &Deployment, merge_deployment: Q, flags: SysrootSimpleWriteDeploymentFlags, cancellable: R) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2018_5", feature = "dox"))]
-    fn stage_tree<'a, 'b, 'c, 'd, P: Into<Option<&'a str>>, Q: Into<Option<&'b glib::KeyFile>>, R: Into<Option<&'c Deployment>>, S: Into<Option<&'d gio::Cancellable>>>(&self, osname: P, revision: &str, origin: Q, merge_deployment: R, override_kernel_argv: &[&str], cancellable: S) -> Result<Deployment, Error>;
-
-    fn try_lock(&self) -> Result<bool, Error>;
-
-    fn unload(&self);
-
-    fn unlock(&self);
-
-    //fn write_deployments<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 19 }, cancellable: P) -> Result<(), Error>;
-
-    //#[cfg(any(feature = "v2017_4", feature = "dox"))]
-    //fn write_deployments_with_options<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 19 }, opts: /*Ignored*/&mut SysrootWriteDeploymentsOpts, cancellable: P) -> Result<(), Error>;
-
-    fn write_origin_file<'a, 'b, P: Into<Option<&'a glib::KeyFile>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, deployment: &Deployment, new_origin: P, cancellable: Q) -> Result<(), Error>;
-
-    #[cfg(any(feature = "v2017_10", feature = "dox"))]
-    fn connect_journal_msg<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId;
-}
-
-impl<O: IsA<Sysroot> + IsA<glib::object::Object> + Clone + 'static> SysrootExt for O {
-    fn cleanup<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn cleanup<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_cleanup(self.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     //#[cfg(any(feature = "v2018_6", feature = "dox"))]
-    //fn cleanup_prune_repo<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: P) -> Result<(i32, i32, u64), Error> {
-    //    unsafe { TODO: call ffi::ostree_sysroot_cleanup_prune_repo() }
+    //pub fn cleanup_prune_repo<P: IsA<gio::Cancellable>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: Option<&P>) -> Result<(i32, i32, u64), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_sysroot_cleanup_prune_repo() }
     //}
 
-    fn deploy_tree<'a, 'b, 'c, 'd, P: Into<Option<&'a str>>, Q: Into<Option<&'b glib::KeyFile>>, R: Into<Option<&'c Deployment>>, S: Into<Option<&'d gio::Cancellable>>>(&self, osname: P, revision: &str, origin: Q, provided_merge_deployment: R, override_kernel_argv: &[&str], cancellable: S) -> Result<Deployment, Error> {
-        let osname = osname.into();
-        let osname = osname.to_glib_none();
-        let origin = origin.into();
-        let origin = origin.to_glib_none();
-        let provided_merge_deployment = provided_merge_deployment.into();
-        let provided_merge_deployment = provided_merge_deployment.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn deploy_tree<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, provided_merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&P>) -> Result<Deployment, Error> {
         unsafe {
             let mut out_new_deployment = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_deploy_tree(self.to_glib_none().0, osname.0, revision.to_glib_none().0, origin.0, provided_merge_deployment.0, override_kernel_argv.to_glib_none().0, &mut out_new_deployment, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_deploy_tree(self.to_glib_none().0, osname.to_glib_none().0, revision.to_glib_none().0, origin.to_glib_none().0, provided_merge_deployment.to_glib_none().0, override_kernel_argv.to_glib_none().0, &mut out_new_deployment, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn deployment_set_kargs<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, deployment: &Deployment, new_kargs: &[&str], cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn deployment_set_kargs<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, new_kargs: &[&str], cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_deployment_set_kargs(self.to_glib_none().0, deployment.to_glib_none().0, new_kargs.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_deployment_set_kargs(self.to_glib_none().0, deployment.to_glib_none().0, new_kargs.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn deployment_set_mutable<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, deployment: &Deployment, is_mutable: bool, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn deployment_set_mutable<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, is_mutable: bool, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_deployment_set_mutable(self.to_glib_none().0, deployment.to_glib_none().0, is_mutable.to_glib(), cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_deployment_set_mutable(self.to_glib_none().0, deployment.to_glib_none().0, is_mutable.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2018_3", feature = "dox"))]
-    fn deployment_set_pinned(&self, deployment: &Deployment, is_pinned: bool) -> Result<(), Error> {
+    pub fn deployment_set_pinned(&self, deployment: &Deployment, is_pinned: bool) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_deployment_set_pinned(self.to_glib_none().0, deployment.to_glib_none().0, is_pinned.to_glib(), &mut error);
+            let _ = ostree_sys::ostree_sysroot_deployment_set_pinned(self.to_glib_none().0, deployment.to_glib_none().0, is_pinned.to_glib(), &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn deployment_unlock<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, deployment: &Deployment, unlocked_state: DeploymentUnlockedState, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn deployment_unlock<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, unlocked_state: DeploymentUnlockedState, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_deployment_unlock(self.to_glib_none().0, deployment.to_glib_none().0, unlocked_state.to_glib(), cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_deployment_unlock(self.to_glib_none().0, deployment.to_glib_none().0, unlocked_state.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn ensure_initialized<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn ensure_initialized<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_ensure_initialized(self.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_ensure_initialized(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn get_booted_deployment(&self) -> Option<Deployment> {
+    pub fn get_booted_deployment(&self) -> Option<Deployment> {
         unsafe {
-            from_glib_none(ffi::ostree_sysroot_get_booted_deployment(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_sysroot_get_booted_deployment(self.to_glib_none().0))
         }
     }
 
-    fn get_bootversion(&self) -> i32 {
+    pub fn get_bootversion(&self) -> i32 {
         unsafe {
-            ffi::ostree_sysroot_get_bootversion(self.to_glib_none().0)
+            ostree_sys::ostree_sysroot_get_bootversion(self.to_glib_none().0)
         }
     }
 
-    fn get_deployment_directory(&self, deployment: &Deployment) -> Option<gio::File> {
+    pub fn get_deployment_directory(&self, deployment: &Deployment) -> Option<gio::File> {
         unsafe {
-            from_glib_full(ffi::ostree_sysroot_get_deployment_directory(self.to_glib_none().0, deployment.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_sysroot_get_deployment_directory(self.to_glib_none().0, deployment.to_glib_none().0))
         }
     }
 
-    fn get_deployment_dirpath(&self, deployment: &Deployment) -> Option<String> {
+    pub fn get_deployment_dirpath(&self, deployment: &Deployment) -> Option<GString> {
         unsafe {
-            from_glib_full(ffi::ostree_sysroot_get_deployment_dirpath(self.to_glib_none().0, deployment.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_sysroot_get_deployment_dirpath(self.to_glib_none().0, deployment.to_glib_none().0))
         }
     }
 
-    //fn get_deployments(&self) -> /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 19 } {
-    //    unsafe { TODO: call ffi::ostree_sysroot_get_deployments() }
+    //pub fn get_deployments(&self) -> /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 19 } {
+    //    unsafe { TODO: call ostree_sys:ostree_sysroot_get_deployments() }
     //}
 
-    fn get_fd(&self) -> i32 {
+    pub fn get_fd(&self) -> i32 {
         unsafe {
-            ffi::ostree_sysroot_get_fd(self.to_glib_none().0)
+            ostree_sys::ostree_sysroot_get_fd(self.to_glib_none().0)
         }
     }
 
-    fn get_merge_deployment<'a, P: Into<Option<&'a str>>>(&self, osname: P) -> Option<Deployment> {
-        let osname = osname.into();
-        let osname = osname.to_glib_none();
+    pub fn get_merge_deployment(&self, osname: Option<&str>) -> Option<Deployment> {
         unsafe {
-            from_glib_full(ffi::ostree_sysroot_get_merge_deployment(self.to_glib_none().0, osname.0))
+            from_glib_full(ostree_sys::ostree_sysroot_get_merge_deployment(self.to_glib_none().0, osname.to_glib_none().0))
         }
     }
 
-    fn get_path(&self) -> Option<gio::File> {
+    pub fn get_path(&self) -> Option<gio::File> {
         unsafe {
-            from_glib_none(ffi::ostree_sysroot_get_path(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_sysroot_get_path(self.to_glib_none().0))
         }
     }
 
-    fn get_repo<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<Repo, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn get_repo<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<Repo, Error> {
         unsafe {
             let mut out_repo = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_get_repo(self.to_glib_none().0, &mut out_repo, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_get_repo(self.to_glib_none().0, &mut out_repo, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_repo)) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2018_5", feature = "dox"))]
-    fn get_staged_deployment(&self) -> Option<Deployment> {
+    pub fn get_staged_deployment(&self) -> Option<Deployment> {
         unsafe {
-            from_glib_none(ffi::ostree_sysroot_get_staged_deployment(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_sysroot_get_staged_deployment(self.to_glib_none().0))
         }
     }
 
-    fn get_subbootversion(&self) -> i32 {
+    pub fn get_subbootversion(&self) -> i32 {
         unsafe {
-            ffi::ostree_sysroot_get_subbootversion(self.to_glib_none().0)
+            ostree_sys::ostree_sysroot_get_subbootversion(self.to_glib_none().0)
         }
     }
 
     #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn init_osname<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, osname: &str, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn init_osname<P: IsA<gio::Cancellable>>(&self, osname: &str, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_init_osname(self.to_glib_none().0, osname.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_init_osname(self.to_glib_none().0, osname.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn load<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn load<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_load(self.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_load(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn load_if_changed<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<bool, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn load_if_changed<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<bool, Error> {
         unsafe {
             let mut out_changed = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_load_if_changed(self.to_glib_none().0, &mut out_changed, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_load_if_changed(self.to_glib_none().0, &mut out_changed, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib(out_changed)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn lock(&self) -> Result<(), Error> {
+    pub fn lock(&self) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_lock(self.to_glib_none().0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_lock(self.to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn lock_async<'a, P: Into<Option<&'a gio::Cancellable>>, Q: FnOnce(Result<(), Error>) + Send + 'static>(&self, cancellable: P, callback: Q) {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
-        let user_data: Box<Box<Q>> = Box::new(Box::new(callback));
-        unsafe extern "C" fn lock_async_trampoline<Q: FnOnce(Result<(), Error>) + Send + 'static>(_source_object: *mut gobject_ffi::GObject, res: *mut gio_ffi::GAsyncResult, user_data: glib_ffi::gpointer)
-        {
+    pub fn lock_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<(), Error>) + Send + 'static>(&self, cancellable: Option<&P>, callback: Q) {
+        let user_data: Box<Q> = Box::new(callback);
+        unsafe extern "C" fn lock_async_trampoline<Q: FnOnce(Result<(), Error>) + Send + 'static>(_source_object: *mut gobject_sys::GObject, res: *mut gio_sys::GAsyncResult, user_data: glib_sys::gpointer) {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);
+            let _ = ostree_sys::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);
             let result = if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) };
-            let callback: Box<Box<Q>> = Box::from_raw(user_data as *mut _);
+            let callback: Box<Q> = Box::from_raw(user_data as *mut _);
             callback(result);
         }
         let callback = lock_async_trampoline::<Q>;
         unsafe {
-            ffi::ostree_sysroot_lock_async(self.to_glib_none().0, cancellable.0, Some(callback), Box::into_raw(user_data) as *mut _);
+            ostree_sys::ostree_sysroot_lock_async(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box::into_raw(user_data) as *mut _);
         }
     }
 
     #[cfg(feature = "futures")]
-    fn lock_async_future(&self) -> Box_<futures_core::Future<Item = (Self, ()), Error = (Self, Error)>> {
+    pub fn lock_async_future(&self) -> Box_<future::Future<Output = Result<(), Error>> + std::marker::Unpin> {
         use gio::GioFuture;
         use fragile::Fragile;
 
         GioFuture::new(self, move |obj, send| {
             let cancellable = gio::Cancellable::new();
             let send = Fragile::new(send);
-            let obj_clone = Fragile::new(obj.clone());
             obj.lock_async(
-                 Some(&cancellable),
-                 move |res| {
-                     let obj = obj_clone.into_inner();
-                     let res = res.map(|v| (obj.clone(), v)).map_err(|v| (obj.clone(), v));
-                     let _ = send.into_inner().send(res);
-                 },
+                Some(&cancellable),
+                move |res| {
+                    let _ = send.into_inner().send(res);
+                },
             );
 
             cancellable
         })
     }
 
-    fn origin_new_from_refspec(&self, refspec: &str) -> Option<glib::KeyFile> {
+    pub fn origin_new_from_refspec(&self, refspec: &str) -> Option<glib::KeyFile> {
         unsafe {
-            from_glib_full(ffi::ostree_sysroot_origin_new_from_refspec(self.to_glib_none().0, refspec.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_sysroot_origin_new_from_refspec(self.to_glib_none().0, refspec.to_glib_none().0))
         }
     }
 
-    fn prepare_cleanup<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn prepare_cleanup<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_prepare_cleanup(self.to_glib_none().0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_prepare_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2017_7", feature = "dox"))]
-    fn query_deployments_for<'a, P: Into<Option<&'a str>>>(&self, osname: P) -> (Deployment, Deployment) {
-        let osname = osname.into();
-        let osname = osname.to_glib_none();
+    pub fn query_deployments_for(&self, osname: Option<&str>) -> (Deployment, Deployment) {
         unsafe {
             let mut out_pending = ptr::null_mut();
             let mut out_rollback = ptr::null_mut();
-            ffi::ostree_sysroot_query_deployments_for(self.to_glib_none().0, osname.0, &mut out_pending, &mut out_rollback);
+            ostree_sys::ostree_sysroot_query_deployments_for(self.to_glib_none().0, osname.to_glib_none().0, &mut out_pending, &mut out_rollback);
             (from_glib_full(out_pending), from_glib_full(out_rollback))
         }
     }
 
     #[cfg(any(feature = "v2017_7", feature = "dox"))]
-    fn repo(&self) -> Option<Repo> {
+    pub fn repo(&self) -> Option<Repo> {
         unsafe {
-            from_glib_none(ffi::ostree_sysroot_repo(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_sysroot_repo(self.to_glib_none().0))
         }
     }
 
-    fn simple_write_deployment<'a, 'b, 'c, P: Into<Option<&'a str>>, Q: Into<Option<&'b Deployment>>, R: Into<Option<&'c gio::Cancellable>>>(&self, osname: P, new_deployment: &Deployment, merge_deployment: Q, flags: SysrootSimpleWriteDeploymentFlags, cancellable: R) -> Result<(), Error> {
-        let osname = osname.into();
-        let osname = osname.to_glib_none();
-        let merge_deployment = merge_deployment.into();
-        let merge_deployment = merge_deployment.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn simple_write_deployment<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, new_deployment: &Deployment, merge_deployment: Option<&Deployment>, flags: SysrootSimpleWriteDeploymentFlags, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_simple_write_deployment(self.to_glib_none().0, osname.0, new_deployment.to_glib_none().0, merge_deployment.0, flags.to_glib(), cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_simple_write_deployment(self.to_glib_none().0, osname.to_glib_none().0, new_deployment.to_glib_none().0, merge_deployment.to_glib_none().0, flags.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
     #[cfg(any(feature = "v2018_5", feature = "dox"))]
-    fn stage_tree<'a, 'b, 'c, 'd, P: Into<Option<&'a str>>, Q: Into<Option<&'b glib::KeyFile>>, R: Into<Option<&'c Deployment>>, S: Into<Option<&'d gio::Cancellable>>>(&self, osname: P, revision: &str, origin: Q, merge_deployment: R, override_kernel_argv: &[&str], cancellable: S) -> Result<Deployment, Error> {
-        let osname = osname.into();
-        let osname = osname.to_glib_none();
-        let origin = origin.into();
-        let origin = origin.to_glib_none();
-        let merge_deployment = merge_deployment.into();
-        let merge_deployment = merge_deployment.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn stage_tree<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&P>) -> Result<Deployment, Error> {
         unsafe {
             let mut out_new_deployment = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_stage_tree(self.to_glib_none().0, osname.0, revision.to_glib_none().0, origin.0, merge_deployment.0, override_kernel_argv.to_glib_none().0, &mut out_new_deployment, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_stage_tree(self.to_glib_none().0, osname.to_glib_none().0, revision.to_glib_none().0, origin.to_glib_none().0, merge_deployment.to_glib_none().0, override_kernel_argv.to_glib_none().0, &mut out_new_deployment, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn try_lock(&self) -> Result<bool, Error> {
+    pub fn try_lock(&self) -> Result<bool, Error> {
         unsafe {
             let mut out_acquired = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_try_lock(self.to_glib_none().0, &mut out_acquired, &mut error);
+            let _ = ostree_sys::ostree_sysroot_try_lock(self.to_glib_none().0, &mut out_acquired, &mut error);
             if error.is_null() { Ok(from_glib(out_acquired)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn unload(&self) {
+    pub fn unload(&self) {
         unsafe {
-            ffi::ostree_sysroot_unload(self.to_glib_none().0);
+            ostree_sys::ostree_sysroot_unload(self.to_glib_none().0);
         }
     }
 
-    fn unlock(&self) {
+    pub fn unlock(&self) {
         unsafe {
-            ffi::ostree_sysroot_unlock(self.to_glib_none().0);
+            ostree_sys::ostree_sysroot_unlock(self.to_glib_none().0);
         }
     }
 
-    //fn write_deployments<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 19 }, cancellable: P) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_sysroot_write_deployments() }
+    //pub fn write_deployments<P: IsA<gio::Cancellable>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 19 }, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_sysroot_write_deployments() }
     //}
 
     //#[cfg(any(feature = "v2017_4", feature = "dox"))]
-    //fn write_deployments_with_options<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 19 }, opts: /*Ignored*/&mut SysrootWriteDeploymentsOpts, cancellable: P) -> Result<(), Error> {
-    //    unsafe { TODO: call ffi::ostree_sysroot_write_deployments_with_options() }
+    //pub fn write_deployments_with_options<P: IsA<gio::Cancellable>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 19 }, opts: /*Ignored*/&mut SysrootWriteDeploymentsOpts, cancellable: Option<&P>) -> Result<(), Error> {
+    //    unsafe { TODO: call ostree_sys:ostree_sysroot_write_deployments_with_options() }
     //}
 
-    fn write_origin_file<'a, 'b, P: Into<Option<&'a glib::KeyFile>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, deployment: &Deployment, new_origin: P, cancellable: Q) -> Result<(), Error> {
-        let new_origin = new_origin.into();
-        let new_origin = new_origin.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn write_origin_file<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, new_origin: Option<&glib::KeyFile>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_write_origin_file(self.to_glib_none().0, deployment.to_glib_none().0, new_origin.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_write_origin_file(self.to_glib_none().0, deployment.to_glib_none().0, new_origin.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
+    pub fn get_deployment_origin_path<P: IsA<gio::File>>(deployment_path: &P) -> Option<gio::File> {
+        unsafe {
+            from_glib_full(ostree_sys::ostree_sysroot_get_deployment_origin_path(deployment_path.as_ref().to_glib_none().0))
+        }
+    }
+
     #[cfg(any(feature = "v2017_10", feature = "dox"))]
-    fn connect_journal_msg<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId {
+    pub fn connect_journal_msg<F: Fn(&Sysroot, &str) + 'static>(&self, f: F) -> SignalHandlerId {
         unsafe {
-            let f: Box_<Box_<Fn(&Self, &str) + 'static>> = Box_::new(Box_::new(f));
-            connect(self.to_glib_none().0, "journal-msg",
-                transmute(journal_msg_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
+            let f: Box_<F> = Box_::new(f);
+            connect_raw(self.as_ptr() as *mut _, b"journal-msg\0".as_ptr() as *const _,
+                Some(transmute(journal_msg_trampoline::<F> as usize)), Box_::into_raw(f))
         }
     }
 }
 
 #[cfg(any(feature = "v2017_10", feature = "dox"))]
-unsafe extern "C" fn journal_msg_trampoline<P>(this: *mut ffi::OstreeSysroot, msg: *mut libc::c_char, f: glib_ffi::gpointer)
-where P: IsA<Sysroot> {
-    let f: &&(Fn(&P, &str) + 'static) = transmute(f);
-    f(&Sysroot::from_glib_borrow(this).downcast_unchecked(), &String::from_glib_none(msg))
+unsafe extern "C" fn journal_msg_trampoline<F: Fn(&Sysroot, &str) + 'static>(this: *mut ostree_sys::OstreeSysroot, msg: *mut libc::c_char, f: glib_sys::gpointer) {
+    let f: &F = &*(f as *const F);
+    f(&from_glib_borrow(this), &GString::from_glib_borrow(msg))
+}
+
+impl fmt::Display for Sysroot {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "Sysroot")
+    }
 }
index 4b504848c611e07c6eba15d7b9000c382141614b..4e51db9c3f2442eec3c1599d8bd69ecbbfe16b89 100644 (file)
@@ -9,180 +9,140 @@ use RepoPullFlags;
 use Sysroot;
 use SysrootUpgraderFlags;
 use SysrootUpgraderPullFlags;
-use ffi;
 use gio;
 use glib;
+use glib::GString;
 use glib::StaticType;
 use glib::Value;
 use glib::object::IsA;
+use glib::object::ObjectType as _;
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
+use gobject_sys;
+use ostree_sys;
+use std::fmt;
 use std::mem;
 use std::ptr;
 
 glib_wrapper! {
-    pub struct SysrootUpgrader(Object<ffi::OstreeSysrootUpgrader>);
+    pub struct SysrootUpgrader(Object<ostree_sys::OstreeSysrootUpgrader, SysrootUpgraderClass>);
 
     match fn {
-        get_type => || ffi::ostree_sysroot_upgrader_get_type(),
+        get_type => || ostree_sys::ostree_sysroot_upgrader_get_type(),
     }
 }
 
 impl SysrootUpgrader {
-    pub fn new<'a, P: Into<Option<&'a gio::Cancellable>>>(sysroot: &Sysroot, cancellable: P) -> Result<SysrootUpgrader, Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn new<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, cancellable: Option<&P>) -> Result<SysrootUpgrader, Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let ret = ffi::ostree_sysroot_upgrader_new(sysroot.to_glib_none().0, cancellable.0, &mut error);
+            let ret = ostree_sys::ostree_sysroot_upgrader_new(sysroot.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    pub fn new_for_os<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(sysroot: &Sysroot, osname: P, cancellable: Q) -> Result<SysrootUpgrader, Error> {
-        let osname = osname.into();
-        let osname = osname.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn new_for_os<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, osname: Option<&str>, cancellable: Option<&P>) -> Result<SysrootUpgrader, Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let ret = ffi::ostree_sysroot_upgrader_new_for_os(sysroot.to_glib_none().0, osname.0, cancellable.0, &mut error);
+            let ret = ostree_sys::ostree_sysroot_upgrader_new_for_os(sysroot.to_glib_none().0, osname.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    pub fn new_for_os_with_flags<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(sysroot: &Sysroot, osname: P, flags: SysrootUpgraderFlags, cancellable: Q) -> Result<SysrootUpgrader, Error> {
-        let osname = osname.into();
-        let osname = osname.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn new_for_os_with_flags<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, osname: Option<&str>, flags: SysrootUpgraderFlags, cancellable: Option<&P>) -> Result<SysrootUpgrader, Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let ret = ffi::ostree_sysroot_upgrader_new_for_os_with_flags(sysroot.to_glib_none().0, osname.0, flags.to_glib(), cancellable.0, &mut error);
+            let ret = ostree_sys::ostree_sysroot_upgrader_new_for_os_with_flags(sysroot.to_glib_none().0, osname.to_glib_none().0, flags.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    pub fn check_timestamps(repo: &Repo, from_rev: &str, to_rev: &str) -> Result<(), Error> {
+    pub fn deploy<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_upgrader_check_timestamps(repo.to_glib_none().0, from_rev.to_glib_none().0, to_rev.to_glib_none().0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_upgrader_deploy(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
-}
-
-pub trait SysrootUpgraderExt {
-    fn deploy<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
-
-    fn dup_origin(&self) -> Option<glib::KeyFile>;
-
-    fn get_origin(&self) -> Option<glib::KeyFile>;
-
-    fn get_origin_description(&self) -> Option<String>;
-
-    fn pull<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: P, cancellable: Q) -> Result<bool, Error>;
-
-    fn pull_one_dir<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, dir_to_pull: &str, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: P, cancellable: Q) -> Result<bool, Error>;
 
-    fn set_origin<'a, 'b, P: Into<Option<&'a glib::KeyFile>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, origin: P, cancellable: Q) -> Result<(), Error>;
-
-    fn get_property_flags(&self) -> SysrootUpgraderFlags;
-
-    fn get_property_osname(&self) -> Option<String>;
-
-    fn get_property_sysroot(&self) -> Option<Sysroot>;
-}
-
-impl<O: IsA<SysrootUpgrader> + IsA<glib::object::Object>> SysrootUpgraderExt for O {
-    fn deploy<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error> {
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn dup_origin(&self) -> Option<glib::KeyFile> {
         unsafe {
-            let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_upgrader_deploy(self.to_glib_none().0, cancellable.0, &mut error);
-            if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+            from_glib_full(ostree_sys::ostree_sysroot_upgrader_dup_origin(self.to_glib_none().0))
         }
     }
 
-    fn dup_origin(&self) -> Option<glib::KeyFile> {
+    pub fn get_origin(&self) -> Option<glib::KeyFile> {
         unsafe {
-            from_glib_full(ffi::ostree_sysroot_upgrader_dup_origin(self.to_glib_none().0))
+            from_glib_none(ostree_sys::ostree_sysroot_upgrader_get_origin(self.to_glib_none().0))
         }
     }
 
-    fn get_origin(&self) -> Option<glib::KeyFile> {
+    pub fn get_origin_description(&self) -> Option<GString> {
         unsafe {
-            from_glib_none(ffi::ostree_sysroot_upgrader_get_origin(self.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_sysroot_upgrader_get_origin_description(self.to_glib_none().0))
         }
     }
 
-    fn get_origin_description(&self) -> Option<String> {
-        unsafe {
-            from_glib_full(ffi::ostree_sysroot_upgrader_get_origin_description(self.to_glib_none().0))
-        }
-    }
-
-    fn pull<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: P, cancellable: Q) -> Result<bool, Error> {
-        let progress = progress.into();
-        let progress = progress.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn pull<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<bool, Error> {
         unsafe {
             let mut out_changed = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_upgrader_pull(self.to_glib_none().0, flags.to_glib(), upgrader_flags.to_glib(), progress.0, &mut out_changed, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_upgrader_pull(self.to_glib_none().0, flags.to_glib(), upgrader_flags.to_glib(), progress.map(|p| p.as_ref()).to_glib_none().0, &mut out_changed, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib(out_changed)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn pull_one_dir<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, dir_to_pull: &str, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: P, cancellable: Q) -> Result<bool, Error> {
-        let progress = progress.into();
-        let progress = progress.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn pull_one_dir<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, dir_to_pull: &str, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<bool, Error> {
         unsafe {
             let mut out_changed = mem::uninitialized();
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_upgrader_pull_one_dir(self.to_glib_none().0, dir_to_pull.to_glib_none().0, flags.to_glib(), upgrader_flags.to_glib(), progress.0, &mut out_changed, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_upgrader_pull_one_dir(self.to_glib_none().0, dir_to_pull.to_glib_none().0, flags.to_glib(), upgrader_flags.to_glib(), progress.map(|p| p.as_ref()).to_glib_none().0, &mut out_changed, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(from_glib(out_changed)) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn set_origin<'a, 'b, P: Into<Option<&'a glib::KeyFile>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, origin: P, cancellable: Q) -> Result<(), Error> {
-        let origin = origin.into();
-        let origin = origin.to_glib_none();
-        let cancellable = cancellable.into();
-        let cancellable = cancellable.to_glib_none();
+    pub fn set_origin<P: IsA<gio::Cancellable>>(&self, origin: Option<&glib::KeyFile>, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();
-            let _ = ffi::ostree_sysroot_upgrader_set_origin(self.to_glib_none().0, origin.0, cancellable.0, &mut error);
+            let _ = ostree_sys::ostree_sysroot_upgrader_set_origin(self.to_glib_none().0, origin.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
             if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
         }
     }
 
-    fn get_property_flags(&self) -> SysrootUpgraderFlags {
+    pub fn get_property_flags(&self) -> SysrootUpgraderFlags {
         unsafe {
             let mut value = Value::from_type(<SysrootUpgraderFlags as StaticType>::static_type());
-            gobject_ffi::g_object_get_property(self.to_glib_none().0, "flags".to_glib_none().0, value.to_glib_none_mut().0);
+            gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"flags\0".as_ptr() as *const _, value.to_glib_none_mut().0);
             value.get().unwrap()
         }
     }
 
-    fn get_property_osname(&self) -> Option<String> {
+    pub fn get_property_osname(&self) -> Option<GString> {
         unsafe {
-            let mut value = Value::from_type(<String as StaticType>::static_type());
-            gobject_ffi::g_object_get_property(self.to_glib_none().0, "osname".to_glib_none().0, value.to_glib_none_mut().0);
+            let mut value = Value::from_type(<GString as StaticType>::static_type());
+            gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"osname\0".as_ptr() as *const _, value.to_glib_none_mut().0);
             value.get()
         }
     }
 
-    fn get_property_sysroot(&self) -> Option<Sysroot> {
+    pub fn get_property_sysroot(&self) -> Option<Sysroot> {
         unsafe {
             let mut value = Value::from_type(<Sysroot as StaticType>::static_type());
-            gobject_ffi::g_object_get_property(self.to_glib_none().0, "sysroot".to_glib_none().0, value.to_glib_none_mut().0);
+            gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"sysroot\0".as_ptr() as *const _, value.to_glib_none_mut().0);
             value.get()
         }
     }
+
+    pub fn check_timestamps(repo: &Repo, from_rev: &str, to_rev: &str) -> Result<(), Error> {
+        unsafe {
+            let mut error = ptr::null_mut();
+            let _ = ostree_sys::ostree_sysroot_upgrader_check_timestamps(repo.to_glib_none().0, from_rev.to_glib_none().0, to_rev.to_glib_none().0, &mut error);
+            if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+        }
+    }
+}
+
+impl fmt::Display for SysrootUpgrader {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "SysrootUpgrader")
+    }
 }
index 1e3acbd1f6f9ca943f2fb00f13b1380ada0e64a1..be52760aa761910c2cdaa573bac8b4f9fa444443 100644 (file)
@@ -1,2 +1,2 @@
-Generated by gir (https://github.com/gtk-rs/gir @ ffda6f9)
+Generated by gir (https://github.com/gtk-rs/gir @ fec179c)
 from gir-files (https://github.com/gtk-rs/gir-files @ ???)
index dd93cb4f7bb02db15e7b109b881d9d11916c41c3..35ea396b2b06d35a84e2b18087e6f0107e3c4d12 100644 (file)
@@ -1,31 +1,30 @@
 // Based on a file generated by gir. Changes are marked below.
-use ffi;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
 use glib::translate::*;
-use glib_ffi;
-use gobject_ffi;
+use glib_sys;
+use gobject_sys;
+use ostree_sys;
 use std::hash;
-use std::mem;
-use std::ptr;
 
 glib_wrapper! {
     #[derive(Debug, PartialOrd, Ord)]
-    pub struct CollectionRef(Boxed<ffi::OstreeCollectionRef>);
+    pub struct CollectionRef(Boxed<ostree_sys::OstreeCollectionRef>);
 
     match fn {
-        copy => |ptr| gobject_ffi::g_boxed_copy(ffi::ostree_collection_ref_get_type(), ptr as *mut _) as *mut ffi::OstreeCollectionRef,
-        free => |ptr| gobject_ffi::g_boxed_free(ffi::ostree_collection_ref_get_type(), ptr as *mut _),
-        get_type => || ffi::ostree_collection_ref_get_type(),
+        copy => |ptr| gobject_sys::g_boxed_copy(ostree_sys::ostree_collection_ref_get_type(), ptr as *mut _) as *mut ostree_sys::OstreeCollectionRef,
+        free => |ptr| gobject_sys::g_boxed_free(ostree_sys::ostree_collection_ref_get_type(), ptr as *mut _),
+        get_type => || ostree_sys::ostree_collection_ref_get_type(),
     }
 }
 
 impl CollectionRef {
     #[cfg(any(feature = "v2018_6", feature = "dox"))]
-    // CHANGE: return type CollectionRef to Option<CollectionRef>
-    pub fn new<'a, P: Into<Option<&'a str>>>(collection_id: P, ref_name: &str) -> Option<CollectionRef> {
-        let collection_id = collection_id.into();
-        let collection_id = collection_id.to_glib_none();
+    pub fn new(collection_id: Option<&str>, ref_name: &str) -> Option<CollectionRef> {
         unsafe {
-            from_glib_full(ffi::ostree_collection_ref_new(collection_id.0, ref_name.to_glib_none().0))
+            from_glib_full(ostree_sys::ostree_collection_ref_new(
+                collection_id.to_glib_none().0,
+                ref_name.to_glib_none().0,
+            ))
         }
     }
 
@@ -33,7 +32,12 @@ impl CollectionRef {
     fn equal(&self, ref2: &CollectionRef) -> bool {
         unsafe {
             // CHANGE: both instances of *mut to *const
-            from_glib(ffi::ostree_collection_ref_equal(ToGlibPtr::<*const ffi::OstreeCollectionRef>::to_glib_none(self).0 as glib_ffi::gconstpointer, ToGlibPtr::<*const ffi::OstreeCollectionRef>::to_glib_none(ref2).0 as glib_ffi::gconstpointer))
+            from_glib(ostree_sys::ostree_collection_ref_equal(
+                ToGlibPtr::<*const ostree_sys::OstreeCollectionRef>::to_glib_none(self).0
+                    as glib_sys::gconstpointer,
+                ToGlibPtr::<*const ostree_sys::OstreeCollectionRef>::to_glib_none(ref2).0
+                    as glib_sys::gconstpointer,
+            ))
         }
     }
 
@@ -41,7 +45,10 @@ impl CollectionRef {
     fn hash(&self) -> u32 {
         unsafe {
             // CHANGE: *mut to *const
-            ffi::ostree_collection_ref_hash(ToGlibPtr::<*const ffi::OstreeCollectionRef>::to_glib_none(self).0 as glib_ffi::gconstpointer)
+            ostree_sys::ostree_collection_ref_hash(
+                ToGlibPtr::<*const ostree_sys::OstreeCollectionRef>::to_glib_none(self).0
+                    as glib_sys::gconstpointer,
+            )
         }
     }
 }
@@ -57,7 +64,10 @@ impl Eq for CollectionRef {}
 
 impl hash::Hash for CollectionRef {
     #[inline]
-    fn hash<H>(&self, state: &mut H) where H: hash::Hasher {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: hash::Hasher,
+    {
         hash::Hash::hash(&self.hash(), state)
     }
 }
index ac0a9e08eeab81d2875f158b8a6ae2b44a86d91d..5dc72deb10cd297413e2aa08f323330c6945cb5d 100644 (file)
@@ -1,6 +1,6 @@
 use super::*;
-use std::hash::{Hash, Hasher};
 use std::collections::hash_map::DefaultHasher;
+use std::hash::{Hash, Hasher};
 
 fn hash(v: &impl Hash) -> u64 {
     let mut s = DefaultHasher::new();
@@ -10,14 +10,14 @@ fn hash(v: &impl Hash) -> u64 {
 
 #[test]
 fn same_value_should_be_equal() {
-    let r = CollectionRef::new("io.gitlab.fkrull", "ref").unwrap();
+    let r = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
     assert_eq!(r, r);
 }
 
 #[test]
 fn equal_values_should_be_equal() {
-    let a = CollectionRef::new("io.gitlab.fkrull", "ref").unwrap();
-    let b = CollectionRef::new("io.gitlab.fkrull", "ref").unwrap();
+    let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
+    let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
     assert_eq!(a, b);
 }
 
@@ -30,48 +30,48 @@ fn equal_values_without_collection_id_should_be_equal() {
 
 #[test]
 fn different_values_should_not_be_equal() {
-    let a = CollectionRef::new("io.gitlab.fkrull", "ref1").unwrap();
-    let b = CollectionRef::new("io.gitlab.fkrull", "ref2").unwrap();
+    let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref1").unwrap();
+    let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref2").unwrap();
     assert_ne!(a, b);
 }
 
 #[test]
 fn new_with_invalid_collection_id_should_return_none() {
-    let r = CollectionRef::new(".abc", "ref");
+    let r = CollectionRef::new(Some(".abc"), "ref");
     assert_eq!(r, None);
 }
 
 #[test]
 fn hash_for_equal_values_should_be_equal() {
-    let a = CollectionRef::new("io.gitlab.fkrull", "ref").unwrap();
-    let b = CollectionRef::new("io.gitlab.fkrull", "ref").unwrap();
+    let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
+    let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
     assert_eq!(hash(&a), hash(&b));
 }
 
 #[test]
 fn hash_for_values_with_different_collection_id_should_be_different() {
-    let a = CollectionRef::new("io.gitlab.fkrull1", "ref").unwrap();
-    let b = CollectionRef::new("io.gitlab.fkrull2", "ref").unwrap();
+    let a = CollectionRef::new(Some("io.gitlab.fkrull1"), "ref").unwrap();
+    let b = CollectionRef::new(Some("io.gitlab.fkrull2"), "ref").unwrap();
     assert_ne!(hash(&a), hash(&b));
 }
 
 #[test]
 fn hash_for_values_with_different_ref_id_should_be_different() {
-    let a = CollectionRef::new("io.gitlab.fkrull", "ref-1").unwrap();
-    let b = CollectionRef::new("io.gitlab.fkrull", "ref-2").unwrap();
+    let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref-1").unwrap();
+    let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref-2").unwrap();
     assert_ne!(hash(&a), hash(&b));
 }
 
 #[test]
 fn hash_should_be_different_if_collection_id_is_absent() {
-    let a = CollectionRef::new("io.gitlab.fkrull", "ref").unwrap();
+    let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
     let b = CollectionRef::new(None, "ref").unwrap();
     assert_ne!(hash(&a), hash(&b));
 }
 
 #[test]
 fn clone_should_be_equal_to_original_value() {
-    let a = CollectionRef::new("io.gitlab.fkrull", "ref").unwrap();
+    let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
     let b = a.clone();
     assert_eq!(a, b);
 }
index 2e6e77bb097232cf8c28bc78f5b7545b80cad242..6344ed1507261acfb31ad68f82fcede2ed1f61b5 100644 (file)
@@ -1,7 +1,7 @@
-extern crate gio_sys as gio_ffi;
-extern crate glib_sys as glib_ffi;
-extern crate gobject_sys as gobject_ffi;
-extern crate ostree_sys as ffi;
+extern crate gio_sys;
+extern crate glib_sys;
+extern crate gobject_sys;
+extern crate ostree_sys;
 #[macro_use]
 extern crate glib;
 extern crate gio;
index abff8c08c5ca37d93f7492a4da5ca8764c8bf245..25635ec7c8ad10ec8122a05056040471d1637098 100644 (file)
@@ -1,8 +1,8 @@
-use ffi;
 use functions::{object_name_deserialize, object_name_serialize, object_to_string};
 use glib;
 use glib::translate::*;
-use glib_ffi;
+use glib_sys;
+use ostree_sys;
 use std::fmt::Display;
 use std::fmt::Error;
 use std::fmt::Formatter;
@@ -11,12 +11,13 @@ use std::hash::Hasher;
 use ObjectType;
 
 fn hash_object_name(v: &glib::Variant) -> u32 {
-    unsafe { ffi::ostree_hash_object_name(v.to_glib_none().0 as glib_ffi::gconstpointer) }
+    unsafe { ostree_sys::ostree_hash_object_name(v.to_glib_none().0 as glib_sys::gconstpointer) }
 }
 
 #[derive(Eq, Debug)]
 pub struct ObjectName {
     variant: glib::Variant,
+    // TODO: can I store a GString here?
     checksum: String,
     object_type: ObjectType,
 }
@@ -26,7 +27,7 @@ impl ObjectName {
         let deserialize = object_name_deserialize(&variant);
         ObjectName {
             variant,
-            checksum: deserialize.0,
+            checksum: deserialize.0.into(),
             object_type: deserialize.1,
         }
     }
@@ -49,9 +50,11 @@ impl ObjectName {
         self.object_type
     }
 
+    // TODO: return GString
     pub fn name(&self) -> String {
         object_to_string(self.checksum(), self.object_type())
             .expect("type checks should make this safe")
+            .into()
     }
 }
 
index 1245496c7933874e65070f534aaf0bea5c653e45..220372e3bb3ae19b6ec8318756d51c2a3fb62f64 100644 (file)
@@ -1,84 +1,85 @@
-use crate::auto::Repo;
+use crate::Repo;
 #[cfg(any(feature = "v2016_4", feature = "dox"))]
-use crate::auto::RepoListRefsExtFlags;
-use ffi;
+use crate::RepoListRefsExtFlags;
 use gio;
 use glib;
 use glib::translate::*;
 use glib::Error;
 use glib::IsA;
-use glib_ffi;
+use glib_sys;
+use ostree_sys;
 use std::collections::{HashMap, HashSet};
 use std::path::Path;
 use std::ptr;
 use ObjectName;
 
 unsafe extern "C" fn read_variant_table(
-    _key: glib_ffi::gpointer,
-    value: glib_ffi::gpointer,
-    hash_set: glib_ffi::gpointer,
+    _key: glib_sys::gpointer,
+    value: glib_sys::gpointer,
+    hash_set: glib_sys::gpointer,
 ) {
-    let value: glib::Variant = from_glib_none(value as *const glib_ffi::GVariant);
+    let value: glib::Variant = from_glib_none(value as *const glib_sys::GVariant);
     let set: &mut HashSet<ObjectName> = &mut *(hash_set as *mut HashSet<ObjectName>);
     set.insert(ObjectName::new_from_variant(value));
 }
 
-unsafe fn from_glib_container_variant_set(ptr: *mut glib_ffi::GHashTable) -> HashSet<ObjectName> {
+unsafe fn from_glib_container_variant_set(ptr: *mut glib_sys::GHashTable) -> HashSet<ObjectName> {
     let mut set = HashSet::new();
-    glib_ffi::g_hash_table_foreach(
+    glib_sys::g_hash_table_foreach(
         ptr,
         Some(read_variant_table),
         &mut set as *mut HashSet<ObjectName> as *mut _,
     );
-    glib_ffi::g_hash_table_unref(ptr);
+    glib_sys::g_hash_table_unref(ptr);
     set
 }
 
 pub trait RepoExtManual {
     fn new_for_path<P: AsRef<Path>>(path: P) -> Repo;
 
-    fn traverse_commit<'a, P: Into<Option<&'a gio::Cancellable>>>(
+    fn traverse_commit<P: IsA<gio::Cancellable>>(
         &self,
         commit_checksum: &str,
         maxdepth: i32,
-        cancellable: P,
+        cancellable: Option<&P>,
     ) -> Result<HashSet<ObjectName>, Error>;
 
-    fn list_refs<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(
+    // TODO: return GString?
+    fn list_refs<P: IsA<gio::Cancellable>>(
         &self,
-        refspec_prefix: P,
-        cancellable: Q,
+        refspec_prefix: Option<&str>,
+        cancellable: Option<&P>,
     ) -> Result<HashMap<String, String>, Error>;
 
     #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn list_refs_ext<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(
+    fn list_refs_ext<P: IsA<gio::Cancellable>>(
         &self,
-        refspec_prefix: P,
+        refspec_prefix: Option<&str>,
         flags: RepoListRefsExtFlags,
-        cancellable: Q,
+        cancellable: Option<&P>,
     ) -> Result<HashMap<String, String>, Error>;
 }
 
-impl<O: IsA<Repo> + IsA<glib::Object> + Clone + 'static> RepoExtManual for O {
+impl<O: IsA<Repo>> RepoExtManual for O {
     fn new_for_path<P: AsRef<Path>>(path: P) -> Repo {
         Repo::new(&gio::File::new_for_path(path.as_ref()))
     }
 
-    fn traverse_commit<'a, P: Into<Option<&'a gio::Cancellable>>>(
+    fn traverse_commit<P: IsA<gio::Cancellable>>(
         &self,
         commit_checksum: &str,
         maxdepth: i32,
-        cancellable: P,
+        cancellable: Option<&P>,
     ) -> Result<HashSet<ObjectName>, Error> {
         unsafe {
             let mut error = ptr::null_mut();
             let mut hashtable = ptr::null_mut();
-            let _ = ffi::ostree_repo_traverse_commit(
-                self.to_glib_none().0,
+            let _ = ostree_sys::ostree_repo_traverse_commit(
+                self.as_ref().to_glib_none().0,
                 commit_checksum.to_glib_none().0,
                 maxdepth,
                 &mut hashtable,
-                cancellable.into().to_glib_none().0,
+                cancellable.map(|p| p.as_ref()).to_glib_none().0,
                 &mut error,
             );
             if error.is_null() {
@@ -89,19 +90,19 @@ impl<O: IsA<Repo> + IsA<glib::Object> + Clone + 'static> RepoExtManual for O {
         }
     }
 
-    fn list_refs<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(
+    fn list_refs<P: IsA<gio::Cancellable>>(
         &self,
-        refspec_prefix: P,
-        cancellable: Q,
+        refspec_prefix: Option<&str>,
+        cancellable: Option<&P>,
     ) -> Result<HashMap<String, String>, Error> {
         unsafe {
             let mut error = ptr::null_mut();
             let mut hashtable = ptr::null_mut();
-            let _ = ffi::ostree_repo_list_refs(
-                self.to_glib_none().0,
-                refspec_prefix.into().to_glib_none().0,
+            let _ = ostree_sys::ostree_repo_list_refs(
+                self.as_ref().to_glib_none().0,
+                refspec_prefix.to_glib_none().0,
                 &mut hashtable,
-                cancellable.into().to_glib_none().0,
+                cancellable.map(|p| p.as_ref()).to_glib_none().0,
                 &mut error,
             );
 
@@ -114,21 +115,21 @@ impl<O: IsA<Repo> + IsA<glib::Object> + Clone + 'static> RepoExtManual for O {
     }
 
     #[cfg(any(feature = "v2016_4", feature = "dox"))]
-    fn list_refs_ext<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(
+    fn list_refs_ext<P: IsA<gio::Cancellable>>(
         &self,
-        refspec_prefix: P,
+        refspec_prefix: Option<&str>,
         flags: RepoListRefsExtFlags,
-        cancellable: Q,
+        cancellable: Option<&P>,
     ) -> Result<HashMap<String, String>, Error> {
         unsafe {
             let mut error = ptr::null_mut();
             let mut hashtable = ptr::null_mut();
-            let _ = ffi::ostree_repo_list_refs_ext(
-                self.to_glib_none().0,
-                refspec_prefix.into().to_glib_none().0,
+            let _ = ostree_sys::ostree_repo_list_refs_ext(
+                self.as_ref().to_glib_none().0,
+                refspec_prefix.to_glib_none().0,
                 &mut hashtable,
                 flags.to_glib(),
-                cancellable.into().to_glib_none().0,
+                cancellable.map(|p| p.as_ref()).to_glib_none().0,
                 &mut error,
             );
 
index 1093a3f1d6463b6d176eecaf82abbd7a9ee0fa5e..6e273b9947b678082f7507374b66a14c0785112a 100644 (file)
@@ -3,15 +3,17 @@ extern crate glib;
 extern crate ostree;
 extern crate tempfile;
 
+use gio::NONE_CANCELLABLE;
 use glib::prelude::*;
 use ostree::prelude::*;
+use ostree::RepoFile;
 use std::fs;
 use std::io;
 use std::io::Write;
 
 fn create_repo(repodir: &tempfile::TempDir) -> Result<ostree::Repo, glib::Error> {
     let repo = ostree::Repo::new_for_path(repodir.path());
-    repo.create(ostree::RepoMode::Archive, None)?;
+    repo.create(ostree::RepoMode::Archive, NONE_CANCELLABLE)?;
     Ok(repo)
 }
 
@@ -27,25 +29,34 @@ fn create_mtree(
 ) -> Result<ostree::MutableTree, glib::Error> {
     let gfile = gio::File::new_for_path(treedir.path());
     let mtree = ostree::MutableTree::new();
-    repo.write_directory_to_mtree(&gfile, &mtree, None, None)?;
+    repo.write_directory_to_mtree(&gfile, &mtree, None, NONE_CANCELLABLE)?;
     Ok(mtree)
 }
 
-fn commit_mtree(
-    repo: &ostree::Repo,
-    mtree: &ostree::MutableTree,
-) -> Result<String, glib::Error> {
-    repo.prepare_transaction(None)?;
-    let repo_file = repo.write_mtree(mtree, None)?.downcast().unwrap();
-    let checksum = repo.write_commit(None, "Test Commit", None, None, &repo_file, None)?;
-    repo.transaction_set_ref(None, "test", checksum.as_str());
-    repo.commit_transaction(None)?;
+fn commit_mtree(repo: &ostree::Repo, mtree: &ostree::MutableTree) -> Result<String, glib::Error> {
+    repo.prepare_transaction(NONE_CANCELLABLE)?;
+    let repo_file = repo
+        .write_mtree(mtree, NONE_CANCELLABLE)?
+        .downcast::<RepoFile>()
+        .unwrap();
+    let checksum = repo
+        .write_commit(
+            None,
+            "Test Commit".into(),
+            None,
+            None,
+            &repo_file,
+            NONE_CANCELLABLE,
+        )?
+        .to_string();
+    repo.transaction_set_ref(None, "test", checksum.as_str().into());
+    repo.commit_transaction(NONE_CANCELLABLE)?;
     Ok(checksum)
 }
 
 fn open_repo(repodir: &tempfile::TempDir) -> Result<ostree::Repo, glib::Error> {
     let repo = ostree::Repo::new_for_path(repodir.path());
-    repo.open(None)?;
+    repo.open(NONE_CANCELLABLE)?;
     Ok(repo)
 }
 
@@ -60,7 +71,9 @@ fn should_commit_content_to_repo_and_list_refs_again() {
     let checksum = commit_mtree(&repo, &mtree).expect("failed to commit mtree");
 
     let repo = open_repo(&repodir).expect("failed to open repo");
-    let refs = repo.list_refs(None, None).expect("failed to list refs");
+    let refs = repo
+        .list_refs(None, NONE_CANCELLABLE)
+        .expect("failed to list refs");
     assert_eq!(refs.len(), 1);
     assert_eq!(refs["test"], checksum);
 }